diff options
author | Mike Christie <michael.christie@oracle.com> | 2023-03-10 16:03:30 -0600 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-03-23 12:45:36 +0100 |
commit | e297cd54b3f81d652456ae6cb93941fc6b5c6683 (patch) | |
tree | 26c7617cb30e3eeb9d4620d1ee0bde257e40b145 /MAINTAINERS | |
parent | 89c8e98d8cfb0656dbeb648572df5b13e372247d (diff) | |
download | lwn-e297cd54b3f81d652456ae6cb93941fc6b5c6683.tar.gz lwn-e297cd54b3f81d652456ae6cb93941fc6b5c6683.zip |
vhost_task: Allow vhost layer to use copy_process
Qemu will create vhost devices in the kernel which perform network, SCSI,
etc IO and management operations from worker threads created by the
kthread API. Because the kthread API does a copy_process on the kthreadd
thread, the vhost layer has to use kthread_use_mm to access the Qemu
thread's memory and cgroup_attach_task_all to add itself to the Qemu
thread's cgroups, and it bypasses the RLIMIT_NPROC limit which can result
in VMs creating more threads than the admin expected.
This patch adds a new struct vhost_task which can be used instead of
kthreads. They allow the vhost layer to use copy_process and inherit
the userspace process's mm and cgroups, the task is accounted for
under the userspace's nproc count and can be seen in its process tree,
and other features like namespaces work and are inherited by default.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'MAINTAINERS')
-rw-r--r-- | MAINTAINERS | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 8d5bc223f305..186d37c2b4e0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22176,7 +22176,9 @@ L: virtualization@lists.linux-foundation.org L: netdev@vger.kernel.org S: Maintained T: git git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git +F: kernel/vhost_task.c F: drivers/vhost/ +F: include/linux/sched/vhost_task.h F: include/linux/vhost_iotlb.h F: include/uapi/linux/vhost.h |