Skip to contentSkip to conversation

io_uring/sqpoll: Do not set PF_NO_SETAFFINITY on sqpoll threads

PATCH Applied Michal Koutný 2 participants 2 messages Mar 14, 2023 – Mar 15, 2023

Subsystems (2)
lore
Share & tools
lore

Michal Koutný

author maintainer
#0 lore raw

PATCH 1/1 io_uring/sqpoll: Do not set PF_NO_SETAFFINITY on sqpoll threads

Users may specify a CPU where the sqpoll thread would run. This may conflict with cpuset operations because of strict PF_NO_SETAFFINITY requirement. That flag is unnecessary for polling "kernel" threads, see the reasoning in commit 01e68ce08a30 ("io_uring/io-wq: stop setting PF_NO_SETAFFINITY on io-wq workers"). Drop the flag on poll threads too.

Fixes 01e68ce08a30 ("io_uring/io-wq: stop setting PF_NO_SETAFFINITY on io-wq workers")
---
 io_uring/sqpoll.c | 1 -
 1 file changed, 1 deletion(-)
io_uring/sqpoll.c +0 -1
index 0119d3f1a556..9db4bc1f521a 100644
@@ -233,7 +233,6 @@ static int io_sq_thread(void *data)
 		set_cpus_allowed_ptr(current, cpumask_of(sqd->sq_cpu));
 	else
 		set_cpus_allowed_ptr(current, cpu_online_mask);
-	current->flags |= PF_NO_SETAFFINITY;
 
 	mutex_lock(&sqd->lock);
 	while (1) {
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 8 lines · Michal Koutný

Users may specify a CPU where the sqpoll thread would run. This may conflict with cpuset operations because of strict PF_NO_SETAFFINITY requirement. That flag is unnecessary for polling "kernel" threads, see the reasoning in commit 01e68ce08a30 ("io_uring/io-wq: stop setting PF_NO_SETAFFINITY on io-wq workers"). Drop the flag on poll threads too.

[...]

Applied, thanks!

[1/1] io_uring/sqpoll: Do not set PF_NO_SETAFFINITY on sqpoll threads

      commit: a5fc1441af7719e93dc7a638a960befb694ade89

Best regards,

Signature · 1 line
Jens Axboe