Re: [PATCH v2] io_uring: simplify the SQPOLL thread check when cancelling requests
From: Jens Axboe
Date: Mon Jan 13 2025 - 17:31:29 EST
On Mon, 13 Jan 2025 23:03:31 +0700, Bui Quang Minh wrote:
> In io_uring_try_cancel_requests, we check whether sq_data->thread ==
> current to determine if the function is called by the SQPOLL thread to do
> iopoll when IORING_SETUP_SQPOLL is set. This check can race with the SQPOLL
> thread termination.
>
> io_uring_cancel_generic is used in 2 places: io_uring_cancel_generic and
> io_ring_exit_work. In io_uring_cancel_generic, we have the information
> whether the current is SQPOLL thread already. And the SQPOLL thread never
> reaches io_ring_exit_work.
>
> [...]
Applied, thanks!
[1/1] io_uring: simplify the SQPOLL thread check when cancelling requests
commit: a13030fd194c88961be4679f87a1380f1bda0ebe
Best regards,
--
Jens Axboe