All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: csander@purestorage.com,  axboe@kernel.dk,
	 io-uring@vger.kernel.org, alok.a.tiwarilinux@gmail.com
Subject: Re: [PATCH v2] io_uring: fix incorrect unlikely() usage in io_waitid_prep()
Date: Mon, 20 Oct 2025 11:00:01 -0400	[thread overview]
Message-ID: <87h5vt39fy.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20251018193300.1517312-1-alok.a.tiwari@oracle.com> (Alok Tiwari's message of "Sat, 18 Oct 2025 12:32:54 -0700")

Alok Tiwari <alok.a.tiwari@oracle.com> writes:

> The negation operator incorrectly places outside the unlikely() macro:
>
>     if (!unlikely(iwa))
>
> This inverted the compiler branch prediction hint, marking the NULL
> case as likely instead of unlikely. The intent is to indicate that
> allocation failures are rare, consistent with common kernel patterns.
>
>  Moving the negation inside unlikely():
>
>     if (unlikely(!iwa))
>
> Fixes: 2b4fc4cd43f2 ("io_uring/waitid: setup async data in the prep handler")
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>


-- 
Gabriel Krisman Bertazi

  parent reply	other threads:[~2025-10-20 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-18 19:32 [PATCH v2] io_uring: fix incorrect unlikely() usage in io_waitid_prep() Alok Tiwari
2025-10-19 16:27 ` Caleb Sander Mateos
2025-10-20 15:23   ` Jens Axboe
2025-10-20 15:00 ` Gabriel Krisman Bertazi [this message]
2025-10-20 15:22 ` 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=87h5vt39fy.fsf@mailhost.krisman.be \
    --to=krisman@suse.de \
    --cc=alok.a.tiwari@oracle.com \
    --cc=alok.a.tiwarilinux@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=io-uring@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.