]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: ublk: improve I/O ordering test with bpftrace
authorMing Lei <ming.lei@redhat.com>
Sat, 31 Jan 2026 16:23:40 +0000 (00:23 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 31 Jan 2026 21:56:28 +0000 (14:56 -0700)
commit5314d25afbc44d0449fa2519d2c9d7f3c319f74c
treee130599f91ca1cc00a1d29390e6942dbc1614885
parentd9a36ab302b1c90d8f03a3b13538b8676eb6ed3b
selftests: ublk: improve I/O ordering test with bpftrace

Remove test_generic_01.sh since block layer may reorder I/O, making
the test prone to false positives. Apply the improvements to
test_generic_02.sh instead, which supposes for covering ublk dispatch
io order.

Rework test_generic_02 to verify that ublk dispatch doesn't reorder I/O
by comparing request start order with completion order using bpftrace.

The bpftrace script now:
- Tracks each request's start sequence number in a map keyed by sector
- On completion, verifies the request's start order matches expected
  completion order
- Reports any out-of-order completions detected

The test script:
- Wait bpftrace BEGIN code block is run
- Pins fio to CPU 0 for deterministic behavior
- Uses block_io_start and block_rq_complete tracepoints
- Checks bpftrace output for reordering errors

Reported-and-tested-by: Alexander Atanasov <alex@zazolabs.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/Makefile
tools/testing/selftests/ublk/test_generic_01.sh [deleted file]
tools/testing/selftests/ublk/test_generic_02.sh
tools/testing/selftests/ublk/trace/seq_io.bt