]> Git Repo - J-linux.git/commitdiff
io_uring/io-wq: inherit cpuset of cgroup in io worker
authorFelix Moessbauer <[email protected]>
Tue, 10 Sep 2024 17:11:57 +0000 (19:11 +0200)
committerJens Axboe <[email protected]>
Wed, 11 Sep 2024 13:27:56 +0000 (07:27 -0600)
The io worker threads are userland threads that just never exit to the
userland. By that, they are also assigned to a cgroup (the group of the
creating task).

When creating a new io worker, this worker should inherit the cpuset
of the cgroup.

Fixes: da64d6db3bd3 ("io_uring: One wqe per wq")
Signed-off-by: Felix Moessbauer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
io_uring/io-wq.c

index c7055a8895d7e8c205f9050dab2243b32d81d72c..a38f36b68060410cd0d326ff574aee7278cf2173 100644 (file)
@@ -1168,7 +1168,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
 
        if (!alloc_cpumask_var(&wq->cpu_mask, GFP_KERNEL))
                goto err;
-       cpumask_copy(wq->cpu_mask, cpu_possible_mask);
+       cpuset_cpus_allowed(data->task, wq->cpu_mask);
        wq->acct[IO_WQ_ACCT_BOUND].max_workers = bounded;
        wq->acct[IO_WQ_ACCT_UNBOUND].max_workers =
                                task_rlimit(current, RLIMIT_NPROC);
This page took 0.070507 seconds and 4 git commands to generate.