From: lizetao <lizetao1@huawei.com>
To: Pavel Begunkov <asml.silence@gmail.com>,
"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Xan Charbonnet <xan@charbonnet.com>,
Salvatore Bonaccorso <carnil@debian.org>
Subject: RE: [PATCH stable-6.1 1/1] io_uring: fix waiters missing wake ups
Date: Sat, 25 Jan 2025 06:59:06 +0000 [thread overview]
Message-ID: <da9d505df3f648ad8660ad6e53a6f77c@huawei.com> (raw)
In-Reply-To: <760086647776a5aebfa77cfff728837d476a4fd8.1737718881.git.asml.silence@gmail.com>
> -----Original Message-----
> From: Pavel Begunkov <asml.silence@gmail.com>
> Sent: Saturday, January 25, 2025 2:54 AM
> To: io-uring@vger.kernel.org; stable@vger.kernel.org
> Cc: asml.silence@gmail.com; Xan Charbonnet <xan@charbonnet.com>;
> Salvatore Bonaccorso <carnil@debian.org>
> Subject: [PATCH stable-6.1 1/1] io_uring: fix waiters missing wake ups
>
> [ upstream commit 3181e22fb79910c7071e84a43af93ac89e8a7106 ]
>
> There are reports of mariadb hangs, which is caused by a missing barrier in the
> waking code resulting in waiters losing events.
>
> The problem was introduced in a backport
> 3ab9326f93ec4 ("io_uring: wake up optimisations"), and the change restores
> the barrier present in the original commit
> 3ab9326f93ec4 ("io_uring: wake up optimisations")
>
> Reported by: Xan Charbonnet <xan@charbonnet.com>
> Fixes: 3ab9326f93ec4 ("io_uring: wake up optimisations")
> Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1093243#99
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
> io_uring/io_uring.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index
> 9b58ba4616d40..e5a8ee944ef59 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -592,8 +592,10 @@ static inline void __io_cq_unlock_post_flush(struct
> io_ring_ctx *ctx)
> io_commit_cqring(ctx);
> spin_unlock(&ctx->completion_lock);
> io_commit_cqring_flush(ctx);
> - if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))
> + if (!(ctx->flags & IORING_SETUP_DEFER_TASKRUN)) {
> + smp_mb();
> __io_cqring_wake(ctx);
> + }
> }
>
> void io_cq_unlock_post(struct io_ring_ctx *ctx)
> --
> 2.47.1
>
Reviewed-by: Li Zetao <lizetao1@huawei.com>
--
Li Zetao
next prev parent reply other threads:[~2025-01-25 6:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 18:53 [PATCH stable-6.1 1/1] io_uring: fix waiters missing wake ups Pavel Begunkov
2025-01-24 20:47 ` Jens Axboe
2025-01-24 21:23 ` Pavel Begunkov
2025-01-24 21:23 ` Jens Axboe
2025-01-25 6:59 ` lizetao [this message]
2025-01-30 8:51 ` Greg KH
2025-01-25 14:03 ` Sasha Levin
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=da9d505df3f648ad8660ad6e53a6f77c@huawei.com \
--to=lizetao1@huawei.com \
--cc=asml.silence@gmail.com \
--cc=carnil@debian.org \
--cc=io-uring@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xan@charbonnet.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 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.