linux-stable/include/linux/sched
Mike Christie e297cd54b3
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>
2023-03-23 12:45:36 +01:00
..
affinity.h
autogroup.h
clock.h sched/clock: Make local_clock() noinstr 2023-01-31 15:01:47 +01:00
cond_resched.h
coredump.h mm: implement memory-deny-write-execute as a prctl 2023-02-02 22:33:24 -08:00
cpufreq.h
cputime.h cputime: remove cputime_to_nsecs fallback 2022-12-27 12:52:17 +01:00
deadline.h
debug.h
hotplug.h
idle.h cpuidle, sched: Remove instrumentation from TIF_{POLLING_NRFLAG,NEED_RESCHED} 2023-01-13 11:48:16 +01:00
init.h
isolation.h
jobctl.h
loadavg.h
mm.h
nohz.h
numa_balancing.h
posix-timers.h
prio.h
rseq_api.h
rt.h
sd_flags.h
signal.h
smt.h
stat.h
sysctl.h sched: Move numa_balancing sysctls to its own file 2022-11-20 20:55:26 -08:00
task.h fork: allow kernel code to call copy_process 2023-03-12 10:54:43 +01:00
task_flags.h
task_stack.h
thread_info_api.h
topology.h
types.h
user.h kernel/user: Allow user_struct::locked_vm to be usable for iommufd 2022-11-30 20:16:49 -04:00
vhost_task.h vhost_task: Allow vhost layer to use copy_process 2023-03-23 12:45:36 +01:00
wake_q.h
xacct.h