On 6/5/24 9:01 AM, Pavel Begunkov wrote: >> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c >> index 96f6da0bf5cd..3ad915262a45 100644 >> --- a/io_uring/io_uring.c >> +++ b/io_uring/io_uring.c >> @@ -234,6 +234,20 @@ static inline void io_req_add_to_cache(struct io_kiocb *req, struct io_ring_ctx >> wq_stack_add_head(&req->comp_list, &ctx->submit_state.free_list); >> } >> +static __cold void io_kworker_tw_start(void) >> +{ >> + if (WARN_ON_ONCE(!(current->flags & PF_NO_TASKWORK))) >> + return; >> + current->flags &= ~PF_NO_TASKWORK; >> +} >> + >> +static __cold void io_kworker_tw_end(void) >> +{ >> + while (task_work_pending(current)) >> + task_work_run(); > > Clear TIF_NOTIFY_SIGNAL/RESUME? Maybe even retrying task_work_run() > after and looping around if there are items to execute. Yeah good point, it should handle clear the notifiers too. Will make that change. -- Jens Axboe