summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-03-10 23:03:26 +0100
committerChristian Brauner (Microsoft) <brauner@kernel.org>2023-03-12 10:54:43 +0100
commit54e6842d0775ba76db65cbe21311c3ca466e663d (patch)
treea530a9aaf2f6cb9a1037c178fba5d111ace28135 /kernel
parentkernel: Make io_thread and kthread bit fields (diff)
downloadlinux-54e6842d0775ba76db65cbe21311c3ca466e663d.tar.xz
linux-54e6842d0775ba76db65cbe21311c3ca466e663d.zip
fork/vm: Move common PF_IO_WORKER behavior to new flag
This adds a new flag, PF_USER_WORKER, that's used for behavior common to to both PF_IO_WORKER and users like vhost which will use a new helper instead of create_io_thread because they require different behavior for operations like signal handling. The common behavior PF_USER_WORKER covers is the vm reclaim handling. 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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 81dfb2532148..fb8ec192c199 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2103,6 +2103,8 @@ static __latent_entropy struct task_struct *copy_process(
p->flags &= ~PF_KTHREAD;
if (args->kthread)
p->flags |= PF_KTHREAD;
+ if (args->user_worker)
+ p->flags |= PF_USER_WORKER;
if (args->io_thread) {
/*
* Mark us an IO worker, and block any signal that isn't
@@ -2630,6 +2632,7 @@ struct task_struct *create_io_thread(int (*fn)(void *), void *arg, int node)
.fn = fn,
.fn_arg = arg,
.io_thread = 1,
+ .user_worker = 1,
};
return copy_process(NULL, 0, node, &args);