From: Juergen Gross <jgross@suse.com>
To: Gui-Dong Han <hanguidong02@gmail.com>,
roger@xenproject.org, xen-devel@lists.xenproject.org
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
konrad.wilk@oracle.com, linux-kernel@vger.kernel.org,
baijiaju1990@gmail.com
Subject: Re: [PATCH] xen/blkback: Prevent missed completion when draining I/O
Date: Fri, 28 Aug 2026 10:19:59 +0200 [thread overview]
Message-ID: <2ddbd454-6220-4e8e-bcb4-b02fb7132563@suse.com> (raw)
In-Reply-To: <20260730084000.3305702-1-hanguidong02@gmail.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 986 bytes --]
On 30.07.26 10:40, Gui-Dong Han wrote:
> xen_blk_drain_io() sets drain before checking inflight.
> xen_blkbk_unmap_and_respond_callback() decrements inflight with
> atomic_dec_and_test() before checking drain.
>
> The pre-wait condition check was added to avoid missing a completion, but
> atomic_set() is unordered. With one I/O in flight, the drain path can set
> drain to 1 and read inflight as 1 before the completion decrement. The
> completion path then decrements inflight to 0 but can still read drain as
> 0. It skips complete(), so the drain path waits until the timeout despite
> no I/O remaining.
>
> Add a full barrier between setting drain and reading inflight.
> atomic_dec_and_test() already provides full ordering on the completion
> side.
>
> Fixes: 6927d92091df ("xen/blkback: Fix two races in the handling of barrier requests.")
> Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
next prev parent reply other threads:[~2026-08-28 8:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 8:40 Gui-Dong Han
2026-07-30 8:43 ` Jan Beulich
2026-07-30 9:25 ` Gui-Dong Han
2026-08-28 8:19 ` Juergen Gross [this message]
2026-08-28 9:37 ` Roger Pau Monné
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=2ddbd454-6220-4e8e-bcb4-b02fb7132563@suse.com \
--to=jgross@suse.com \
--cc=axboe@kernel.dk \
--cc=baijiaju1990@gmail.com \
--cc=hanguidong02@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roger@xenproject.org \
--cc=xen-devel@lists.xenproject.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®