Skip to contentSkip to conversation

io_uring/sqpoll: ensure that normal task_work is also run timely

PATCH Superseded Jens Axboe 1 participant 1 message May 21, 2024 io_uring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring/sqpoll: ensure that normal task_work is also run timely

With the move to private task_work, SQPOLL neglected to also run the normal task_work, if any is pending. This will eventually get run, but we should run it with the private task_work to ensure that things like a final fput() is processed in a timely fashion.

Fixes af5d68f8892f ("io_uring/sqpoll: manage task_work privately")

---

io_uring/sqpoll.c +2 -0
index 554c7212aa46..68a3e3290411 100644
@@ -241,6 +241,8 @@ static unsigned int io_sq_tw(struct llist_node **retry_list, int max_entries)
 			return count;
 		max_entries -= count;
 	}
+	if (task_work_pending(current))
+		task_work_run();
 
 	*retry_list = tctx_task_work_run(tctx, max_entries, &count);
 	return count;
Signature · 1 line
Jens Axboe