public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring/sqpoll: ensure that normal task_work is also run timely
@ 2024-05-21 18:34 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2024-05-21 18:34 UTC (permalink / raw)
  To: io-uring; +Cc: Andrew Udvare

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.

Cc: [email protected]
Link: https://lore.kernel.org/all/[email protected]/
Reported-by: Andrew Udvare <[email protected]>
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 554c7212aa46..68a3e3290411 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -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;

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-21 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21 18:34 [PATCH] io_uring/sqpoll: ensure that normal task_work is also run timely Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox