Re: [PATCH] io_uring/timeout: don't rearm a multishot timeout on cancel
From: Cheng Yongkang
Date: Mon Nov 16 2026 - 21:46:55 EST
On 11/16/26 7:41 PM, Jens Axboe wrote:
> But why would the app do that, to shoot itself in the foot?
>
> I think the fix is fine, but the premise of it is very odd.
Agreed, no sane app would do that. The only thing that made it look
worth fixing to me is where the cost lands. The drain runs from
io_ring_exit_work() after the task has closed the ring, so the time is
spent in a kworker holding uring_lock, and the app can no longer stop
it by being killed.
Without the bogus CQ head the timeout is still rearmed during cancel,
it just stops once the CQ is full, so the change mostly makes the
timeout handler skip the rearm like the other cancel paths do.
I can reword the commit message to lead with that instead, if you
prefer.
Thanks,
Cheng Yongkang