public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ren Wei <n05ec@lzu.edu.cn>, io-uring@vger.kernel.org
Cc: asml.silence@gmail.com, yifanwucs@gmail.com,
	tomapufckgml@gmail.com, yuantan098@gmail.com, bird@lzu.edu.cn,
	zcliangcn@gmail.com, ylong030@ucr.edu
Subject: Re: [PATCH 1/1] io_uring/poll: fix signed comparison in io_poll_get_ownership()
Date: Wed, 15 Apr 2026 14:09:06 -0600	[thread overview]
Message-ID: <6dc4f9dd-975b-436f-889b-7c584bc18e62@kernel.dk> (raw)
In-Reply-To: <3a3508b08bcd7f1bc3beff848ae6e1d73d355043.1775965597.git.ylong030@ucr.edu>

On 4/12/26 2:38 AM, Ren Wei wrote:
> From: Longxuan Yu <ylong030@ucr.edu>
> 
> io_poll_get_ownership() uses a signed comparison to check whether
> poll_refs has reached the threshold for the slowpath:
> 
>     if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS))
> 
> atomic_read() returns int (signed). When IO_POLL_CANCEL_FLAG
> (BIT(31)) is set in poll_refs, the value becomes negative in
> signed arithmetic, so the >= 128 comparison always evaluates to
> false and the slowpath is never taken.
> 
> Fix this by casting the atomic_read() result to unsigned int
> before the comparison, so that the cancel flag is treated as a
> large positive value and correctly triggers the slowpath.
> 
> Fixes: aa43477b0402 ("io_uring: poll rework")

Is this correct? Seems it should be:

Fixes: a26a35e9019f ("io_uring: make poll refs more robust")

-- 
Jens Axboe


  parent reply	other threads:[~2026-04-15 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1775965597.git.ylong030@ucr.edu>
2026-04-12  8:38 ` [PATCH 1/1] io_uring/poll: fix signed comparison in io_poll_get_ownership() Ren Wei
2026-04-14 10:50   ` Pavel Begunkov
2026-04-15 20:08   ` Jens Axboe
2026-04-15 20:09   ` Jens Axboe [this message]
2026-04-16  1:50     ` Yuan Tan
2026-04-16 15:28       ` 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=6dc4f9dd-975b-436f-889b-7c584bc18e62@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=bird@lzu.edu.cn \
    --cc=io-uring@vger.kernel.org \
    --cc=n05ec@lzu.edu.cn \
    --cc=tomapufckgml@gmail.com \
    --cc=yifanwucs@gmail.com \
    --cc=ylong030@ucr.edu \
    --cc=yuantan098@gmail.com \
    --cc=zcliangcn@gmail.com \
    /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