Re: [PATCH] io_uring: prevent sq_thread from spinning when it should stop

From: Jens Axboe
Date: Fri Feb 21 2020 - 11:16:40 EST


On 2/21/20 8:42 AM, Stefano Garzarella wrote:
> This patch drops 'cur_mm' before calling cond_resched(), to prevent
> the sq_thread from spinning even when the user process is finished.
>
> Before this patch, if the user process ended without closing the
> io_uring fd, the sq_thread continues to spin until the
> 'sq_thread_idle' timeout ends.
>
> In the worst case where the 'sq_thread_idle' parameter is bigger than
> INT_MAX, the sq_thread will spin forever.

Thanks, applied.

--
Jens Axboe