diff options
| author | Gui-Dong Han <hanguidong02@gmail.com> | 2026-07-30 16:40:00 +0800 |
|---|---|---|
| committer | Juergen Gross <jgross@suse.com> | 2026-10-09 09:58:46 +0200 |
| commit | 9b4df0baa2aa03d22310e59846ca628f7afd4115 (patch) | |
| tree | 00e163c3109f20f0709fa35067226ab55710d09c /tools/perf/scripts/python/stackcollapse.py | |
| parent | 5d12c51bd98cdb5a32cbfb606963b05740ec42f2 (diff) | |
| download | linux-9b4df0baa2aa03d22310e59846ca628f7afd4115.tar.gz linux-9b4df0baa2aa03d22310e59846ca628f7afd4115.zip | |
xen/blkback: Prevent missed completion when draining I/O
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>
Acked-by: Roger Pau Monné <roger@xenproject.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20260730084000.3305702-1-hanguidong02@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
