linux-samsung-r9q2/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 sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
autogroup.h
clock.h sched/clock: Make local_clock() noinstr 2023-01-31 15:01:47 +01:00
cond_resched.h sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
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 sched/headers: Make the <linux/sched/deadline.h> header build standalone 2022-02-23 10:58:33 +01:00
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 sched/isolation: Use single feature type while referring to housekeeping cpumask 2022-02-16 15:57:55 +01:00
jobctl.h sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state 2022-05-11 14:37:06 -05:00
loadavg.h
mm.h docs: rename Documentation/vm to Documentation/mm 2022-06-27 12:52:53 -07:00
nohz.h
numa_balancing.h
posix-timers.h sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
prio.h
rseq_api.h sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
rt.h sched/core: Always flush pending blk_plug 2022-07-13 11:29:17 +02:00
sd_flags.h
signal.h signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit 2022-07-20 10:23:51 -05:00
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 sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
task_stack.h task_stack, x86/cea: Force-inline stack helpers 2022-04-04 10:13:07 +02:00
thread_info_api.h sched/headers: Add initial new headers as identity mappings 2022-02-23 10:58:28 +01:00
topology.h sched/fair: Introduce SIS_UTIL to search idle CPU based on sum of util_avg 2022-06-28 09:08:30 +02:00
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