Skip to content

Commit 6434ec0

Browse files
committed
io_uring: don't use TIF_NOTIFY_SIGNAL to test for availability of task_work
Use task_work_pending() as a better test for whether we have task_work or not, TIF_NOTIFY_SIGNAL is only valid if the any of the task_work items had been queued with TWA_SIGNAL as the notification mechanism. Hence task_work_pending() is a more reliable check. Signed-off-by: Jens Axboe <[email protected]>
1 parent 44a84da commit 6434ec0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

io_uring/io_uring.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ static inline int io_run_task_work(void)
266266

267267
static inline bool io_task_work_pending(struct io_ring_ctx *ctx)
268268
{
269-
return test_thread_flag(TIF_NOTIFY_SIGNAL) ||
270-
!wq_list_empty(&ctx->work_llist);
269+
return task_work_pending(current) || !wq_list_empty(&ctx->work_llist);
271270
}
272271

273272
static inline int io_run_task_work_ctx(struct io_ring_ctx *ctx)

0 commit comments

Comments
 (0)