<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/ublk/Makefile, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-01-31T21:56:28Z</updated>
<entry>
<title>selftests: ublk: improve I/O ordering test with bpftrace</title>
<updated>2026-01-31T21:56:28Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-31T16:23:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5314d25afbc44d0449fa2519d2c9d7f3c319f74c'/>
<id>urn:sha1:5314d25afbc44d0449fa2519d2c9d7f3c319f74c</id>
<content type='text'>
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 &lt;alex@zazolabs.com&gt;
Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: reorganize tests into integrity and recover groups</title>
<updated>2026-01-31T21:56:28Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-31T16:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9a36ab302b1c90d8f03a3b13538b8676eb6ed3b'/>
<id>urn:sha1:d9a36ab302b1c90d8f03a3b13538b8676eb6ed3b</id>
<content type='text'>
Move integrity-focused tests into new 'integrity' group:
- test_null_04.sh -&gt; test_integrity_01.sh
- test_loop_08.sh -&gt; test_integrity_02.sh

Move recovery-focused tests into new 'recover' group:
- test_generic_04.sh -&gt; test_recover_01.sh
- test_generic_05.sh -&gt; test_recover_02.sh
- test_generic_11.sh -&gt; test_recover_03.sh
- test_generic_14.sh -&gt; test_recover_04.sh

Update Makefile to reflect the reorganization.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: add _ublk_sleep helper for parallel execution</title>
<updated>2026-01-31T21:56:28Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-31T16:23:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64406dd2f69fe27921c7bf06088871c002cf6186'/>
<id>urn:sha1:64406dd2f69fe27921c7bf06088871c002cf6186</id>
<content type='text'>
Add _ublk_sleep() helper function that uses different sleep times
depending on whether tests run in parallel or sequential mode.

Usage: _ublk_sleep &lt;normal_secs&gt; &lt;parallel_secs&gt;

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 &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: add group-based test targets</title>
<updated>2026-01-31T21:56:28Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-31T16:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6bbc3bec19efd557f888d78865b627b80b37a32'/>
<id>urn:sha1:b6bbc3bec19efd557f888d78865b627b80b37a32</id>
<content type='text'>
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_&lt;group&gt;_&lt;num&gt;.sh -&gt; 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&gt;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 &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: rename test_generic_15 to test_part_02</title>
<updated>2026-01-31T13:36:41Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-29T16:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a30d3dfea4a455d1109d5258fe332f2157071ba'/>
<id>urn:sha1:7a30d3dfea4a455d1109d5258fe332f2157071ba</id>
<content type='text'>
This test exercises partition scanning behavior, so move it to
the test_part_* group for consistency.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: add selftest for UBLK_F_NO_AUTO_PART_SCAN</title>
<updated>2026-01-31T13:36:41Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-29T16:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e07a2039b6d4ae3acf8ae39b86be449b7fa18d4a'/>
<id>urn:sha1:e07a2039b6d4ae3acf8ae39b86be449b7fa18d4a</id>
<content type='text'>
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 &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: support arbitrary threads/queues combination</title>
<updated>2026-01-23T03:05:41Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-16T14:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e8cd481cc665d5db8e918e84740db22bc213059e'/>
<id>urn:sha1:e8cd481cc665d5db8e918e84740db22bc213059e</id>
<content type='text'>
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 &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: add --batch/-b for enabling F_BATCH_IO</title>
<updated>2026-01-23T03:05:41Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-16T14:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=20aeab0b08a175d9ceb4ad327f55ba5c29a79888'/>
<id>urn:sha1:20aeab0b08a175d9ceb4ad327f55ba5c29a79888</id>
<content type='text'>
Add --batch/-b for enabling F_BATCH_IO.

Add batch_01 for covering its basic function.

Add stress_08 and stress_09 for covering stress test.

Add recovery test for F_BATCH_IO in generic_04 and generic_05.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: increase timeout to 150 seconds</title>
<updated>2026-01-23T03:05:41Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-16T14:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4968fb7cc60676040258c8867f22931c8735126f'/>
<id>urn:sha1:4968fb7cc60676040258c8867f22931c8735126f</id>
<content type='text'>
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 &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>selftests: ublk: add stop command with --safe option</title>
<updated>2026-01-12T22:07:31Z</updated>
<author>
<name>Ming Lei</name>
</author>
<published>2026-01-12T22:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65955a0993a0a9536263fea2eaae8aed496dcc9c'/>
<id>urn:sha1:65955a0993a0a9536263fea2eaae8aed496dcc9c</id>
<content type='text'>
Add 'stop' subcommand to kublk utility that uses the new
UBLK_CMD_TRY_STOP_DEV command when --safe option is specified.
This allows stopping a device only if it has no active openers,
returning -EBUSY otherwise.

Also add test_generic_16.sh to test the new functionality.

Signed-off-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
