| 5314d25a | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
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
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>
show more ...
|
| d9a36ab3 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: reorganize tests into integrity and recover groups
Move integrity-focused tests into new 'integrity' group: - test_null_04.sh -> test_integrity_01.sh - test_loop_08.sh -> test_integ
selftests: ublk: reorganize tests into integrity and recover groups
Move integrity-focused tests into new 'integrity' group: - test_null_04.sh -> test_integrity_01.sh - test_loop_08.sh -> test_integrity_02.sh
Move recovery-focused tests into new 'recover' group: - test_generic_04.sh -> test_recover_01.sh - test_generic_05.sh -> test_recover_02.sh - test_generic_11.sh -> test_recover_03.sh - test_generic_14.sh -> test_recover_04.sh
Update Makefile to reflect the reorganization.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 56a08b87 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: increase timeouts for parallel test execution
When running tests in parallel with high JOBS count (e.g., JOBS=64), the existing timeouts can be insufficient due to system load:
- I
selftests: ublk: increase timeouts for parallel test execution
When running tests in parallel with high JOBS count (e.g., JOBS=64), the existing timeouts can be insufficient due to system load:
- Increase state wait loops from 20/50 to 100 iterations in _recover_ublk_dev(), __ublk_quiesce_dev(), and __ublk_kill_daemon() to handle slower state transitions under heavy load
- Add --timeout=20 to udevadm settle calls to prevent indefinite hangs when udev event queue is overwhelmed by rapid device creation/deletion
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 64406dd2 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: add _ublk_sleep helper for parallel execution
Add _ublk_sleep() helper function that uses different sleep times depending on whether tests run in parallel or sequential mode.
Usage
selftests: ublk: add _ublk_sleep helper for parallel execution
Add _ublk_sleep() helper function that uses different sleep times depending on whether tests run in parallel or sequential mode.
Usage: _ublk_sleep <normal_secs> <parallel_secs>
Export JOBS variable from Makefile so test scripts can detect parallel execution, and use _ublk_sleep in test_part_02.sh to handle the partition scan delay (1s normal, 5s parallel).
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| b6bbc3be | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: add group-based test targets
Add convenient Makefile targets for running specific test groups: - run_generic, run_batch, run_null, run_loop, run_stripe, run_stress, etc. - run_all f
selftests: ublk: add group-based test targets
Add convenient Makefile targets for running specific test groups: - run_generic, run_batch, run_null, run_loop, run_stripe, run_stress, etc. - run_all for running all tests
Test groups are auto-detected from TEST_PROGS using pattern matching (test_<group>_<num>.sh -> group), and targets are generated dynamically using define/eval templates.
Supports parallel execution via JOBS variable: - JOBS=1 (default): sequential with kselftest TAP output - JOBS>1: parallel execution with xargs -P
Usage examples: make run_null # Sequential execution make run_stress JOBS=4 # Parallel with 4 jobs make run_all JOBS=8 # Run all tests with 8 parallel jobs
With JOBS=8, running time of `make run_all` is reduced to 2m2s from 6m5s in my test VM.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 2021e610 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: track created devices for per-test cleanup
Track device IDs in UBLK_DEVS array when created. Update _cleanup_test() to only delete devices created by this test instead of using 'del
selftests: ublk: track created devices for per-test cleanup
Track device IDs in UBLK_DEVS array when created. Update _cleanup_test() to only delete devices created by this test instead of using 'del -a' which removes all devices.
This prepares for running tests concurrently where each test should only clean up its own devices.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 92734a4f | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: add _ublk_del_dev helper function
Add _ublk_del_dev() to delete a specific ublk device by ID and use it in all test scripts instead of calling UBLK_PROG directly.
Also remove unuse
selftests: ublk: add _ublk_del_dev helper function
Add _ublk_del_dev() to delete a specific ublk device by ID and use it in all test scripts instead of calling UBLK_PROG directly.
Also remove unused _remove_ublk_devices() function.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 842b6520 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: refactor test_loop_08 into separate functions
Encapsulate each test case in its own function for better organization and maintainability:
- _setup_device(): device and backfile ini
selftests: ublk: refactor test_loop_08 into separate functions
Encapsulate each test case in its own function for better organization and maintainability:
- _setup_device(): device and backfile initialization - _test_fill_and_verify(): initial data population - _test_corrupted_reftag(): reftag corruption detection test - _test_corrupted_data(): data corruption detection test - _test_bad_apptag(): apptag mismatch detection test
Also fix temp file creation to use ${UBLK_TEST_DIR}/fio_err_XXXXX instead of creating in current directory.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 5af302a1 | 31-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: simplify UBLK_TEST_DIR handling
Remove intermediate TDIR variable and set UBLK_TEST_DIR directly in _prep_test(). Remove default initialization since the directory is created dynami
selftests: ublk: simplify UBLK_TEST_DIR handling
Remove intermediate TDIR variable and set UBLK_TEST_DIR directly in _prep_test(). Remove default initialization since the directory is created dynamically when tests run.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 2feca79e | 29-Jan-2026 |
Alexander Atanasov <alex@zazolabs.com> |
selftests: ublk: move test temp files into a sub directory
Create and use a temporary directory for the files created during test runs. If TMPDIR environment variable is set use it as a base for the
selftests: ublk: move test temp files into a sub directory
Create and use a temporary directory for the files created during test runs. If TMPDIR environment variable is set use it as a base for the temporary directory path. TMPDIR=/mnt/scratch make run_tests and TMPDIR=/mnt/scratch ./test_generic_01.sh will place test directory under /mnt/scratch
Signed-off-by: Alexander Atanasov <alex@zazolabs.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 4e0d293a | 29-Jan-2026 |
Alexander Atanasov <alex@zazolabs.com> |
selftests: ublk: mark each test start and end time in dmesg
Log test start and end time in dmesg, so generated log messages during the test run can be linked to specific test from the test suite.
(
selftests: ublk: mark each test start and end time in dmesg
Log test start and end time in dmesg, so generated log messages during the test run can be linked to specific test from the test suite.
(switch to `date +%F %T`)
Signed-off-by: Alexander Atanasov <alex@zazolabs.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 76334de7 | 29-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: disable partition scan for integrity tests
The null target doesn't handle IO, so disable partition scan to avoid IO failures caused by integrity verification during the kernel's par
selftests: ublk: disable partition scan for integrity tests
The null target doesn't handle IO, so disable partition scan to avoid IO failures caused by integrity verification during the kernel's partition table read.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 13097535 | 29-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: refactor test_null_04 into separate functions
Encapsulate each test case in its own function that creates the device, runs checks, and deletes only that device. This avoids calling
selftests: ublk: refactor test_null_04 into separate functions
Encapsulate each test case in its own function that creates the device, runs checks, and deletes only that device. This avoids calling _cleanup_test multiple times.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 7a30d3df | 29-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: rename test_generic_15 to test_part_02
This test exercises partition scanning behavior, so move it to the test_part_* group for consistency.
Signed-off-by: Ming Lei <ming.lei@redha
selftests: ublk: rename test_generic_15 to test_part_02
This test exercises partition scanning behavior, so move it to the test_part_* group for consistency.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| e07a2039 | 29-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: add selftest for UBLK_F_NO_AUTO_PART_SCAN
Add test_part_01.sh to test the UBLK_F_NO_AUTO_PART_SCAN feature flag which allows suppressing automatic partition scanning during device s
selftests: ublk: add selftest for UBLK_F_NO_AUTO_PART_SCAN
Add test_part_01.sh to test the UBLK_F_NO_AUTO_PART_SCAN feature flag which allows suppressing automatic partition scanning during device startup while still allowing manual partition probing.
The test verifies: - Normal behavior: partitions are auto-detected without the flag - With flag: partitions are not auto-detected during START_DEV - Manual scan: blockdev --rereadpt works with the flag
Also update kublk tool to support --no_auto_part_scan option and recognize the feature flag.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 8e5bcc3a | 25-Jan-2026 |
Alexander Atanasov <alex@zazolabs.com> |
selftests: ublk: add missing gitignore for metadata_size binary
A new utility metadata_size was added in commit 261b67f4e347 ("selftests: ublk: add utility to get block device metadata size") but it
selftests: ublk: add missing gitignore for metadata_size binary
A new utility metadata_size was added in commit 261b67f4e347 ("selftests: ublk: add utility to get block device metadata size") but it was not added to .gitignore. Fix that by adding it there.
While at it sort all entries alphabetically and add a SPDX license header.
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com> Fixes: 261b67f4e347 ("selftests: ublk: add utility to get block device metadata size") Signed-off-by: Alexander Atanasov <alex@zazolabs.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| e8cd481c | 16-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: support arbitrary threads/queues combination
Enable flexible thread-to-queue mapping in batch I/O mode to support arbitrary combinations of threads and queues, improving resource ut
selftests: ublk: support arbitrary threads/queues combination
Enable flexible thread-to-queue mapping in batch I/O mode to support arbitrary combinations of threads and queues, improving resource utilization and scalability.
Key improvements: - Support N:M thread-to-queue mapping (previously limited to 1:1) - Dynamic buffer allocation based on actual queue assignment per thread - Thread-safe queue preparation with spinlock protection - Intelligent buffer index calculation for multi-queue scenarios - Enhanced validation for thread/queue combination constraints
Implementation details: - Add q_thread_map matrix to track queue-to-thread assignments - Dynamic allocation of commit and fetch buffers per thread - Round-robin queue assignment algorithm for load balancing - Per-queue spinlock to prevent race conditions during prep - Updated buffer index calculation using queue position within thread
This enables efficient configurations like: - Any other N:M combinations for optimal resource matching
Testing: - Added test_batch_02.sh: 4 threads vs 1 queue - Added test_batch_03.sh: 1 thread vs 4 queues - Validates correctness across different mapping scenarios
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| 4968fb7c | 16-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: increase timeout to 150 seconds
More tests need to be covered in existing generic tests, and default 45sec isn't enough, and timeout is often triggered, increase timeout by adding s
selftests: ublk: increase timeout to 150 seconds
More tests need to be covered in existing generic tests, and default 45sec isn't enough, and timeout is often triggered, increase timeout by adding setting file.
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
| cb5a6b30 | 16-Jan-2026 |
Ming Lei <ming.lei@redhat.com> |
selftests: ublk: handle UBLK_U_IO_FETCH_IO_CMDS
Add support for UBLK_U_IO_FETCH_IO_CMDS to enable efficient batch fetching of I/O commands using multishot io_uring operations.
Key improvements: - I
selftests: ublk: handle UBLK_U_IO_FETCH_IO_CMDS
Add support for UBLK_U_IO_FETCH_IO_CMDS to enable efficient batch fetching of I/O commands using multishot io_uring operations.
Key improvements: - Implement multishot UBLK_U_IO_FETCH_IO_CMDS for continuous command fetching - Add fetch buffer management with page-aligned, mlocked buffers - Process fetched I/O command tags from kernel-provided buffers - Integrate fetch operations with existing batch I/O infrastructure - Significantly reduce uring_cmd issuing overhead through batching
The implementation uses two fetch buffers per thread with automatic requeuing to maintain continuous I/O command flow. Each fetch operation retrieves multiple command tags in a single syscall, dramatically improving performance compared to individual command fetching.
Technical details: - Fetch buffers are page-aligned and mlocked for optimal performance - Uses IORING_URING_CMD_MULTISHOT for continuous operation - Automatic buffer management and requeuing on completion - Enhanced CQE handling for fetch command completions
Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|