mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cheng Yongkang <teel4res@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: David Wei <davidhwei@meta.com>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/timeout: don't rearm a multishot timeout on cancel
Date: Mon, 16 Nov 2026 18:46:43 -0800	[thread overview]
Message-ID: <20261117024643.478059-1-teel4res@gmail.com> (raw)
In-Reply-To: <71233dfb-bcac-42df-afd4-45b65dabbc09@kernel.dk>

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

  reply	other threads:[~2026-11-17  2:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  4:45 Cheng Yongkang
2026-11-17  2:41 ` Jens Axboe
2026-11-17  2:46   ` Cheng Yongkang [this message]
2026-11-17  2:48     ` Jens Axboe
2026-11-17  2:49 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117024643.478059-1-teel4res@gmail.com \
    --to=teel4res@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=davidhwei@meta.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®