Skip to content

Commit 84eacf1

Browse files
fmoessbaueraxboe
authored andcommitted
io_uring/io-wq: inherit cpuset of cgroup in io worker
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: da64d6d ("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]>
1 parent 0997aa5 commit 84eacf1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/io-wq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
11681168

11691169
if (!alloc_cpumask_var(&wq->cpu_mask, GFP_KERNEL))
11701170
goto err;
1171-
cpumask_copy(wq->cpu_mask, cpu_possible_mask);
1171+
cpuset_cpus_allowed(data->task, wq->cpu_mask);
11721172
wq->acct[IO_WQ_ACCT_BOUND].max_workers = bounded;
11731173
wq->acct[IO_WQ_ACCT_UNBOUND].max_workers =
11741174
task_rlimit(current, RLIMIT_NPROC);

0 commit comments

Comments
 (0)