Skip to content

Commit 38fc9b8

Browse files
bvanasscheosandov
authored andcommitted
tests/block/031: Add a test for sharing a tag set across hardware queues
Support for sharing a tag set across hardware queues has been added recently to the Linux kernel. See also the BLK_MQ_F_TAG_HCTX_SHARED flag, Linux kernel commit 32bc15afed04 ("blk-mq: Facilitate a shared sbitmap per tagset"; v5.10) and commit 0905053bdb5b ("null_blk: Support shared tag bitmap"; v5.10). Add a test that triggers the shared tag set code in the block layer core. Cc: John Garry <[email protected]> Cc: Don Brace<[email protected]> Cc: Douglas Gilbert <[email protected]> Signed-off-by: Bart Van Assche <[email protected]>
1 parent cebd899 commit 38fc9b8

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

tests/block/031

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
# Copyright 2021 Google LLC
4+
#
5+
# Test support for sharing a tag set across hardware queues ("host tag set").
6+
7+
. tests/block/rc
8+
. common/null_blk
9+
10+
DESCRIPTION="do IO on null-blk with a host tag set"
11+
TIMED=1
12+
13+
requires() {
14+
_have_null_blk && _have_module_param null_blk shared_tag_bitmap
15+
}
16+
17+
test() {
18+
local fio_status bs=512
19+
20+
: "${TIMEOUT:=30}"
21+
if ! _init_null_blk nr_devices=0 queue_mode=2 shared_tag_bitmap=1; then
22+
echo "Loading null_blk failed"
23+
return 1
24+
fi
25+
if ! _configure_null_blk nullb0 completion_nsec=0 blocksize=$bs size=1\
26+
submit_queues="$(nproc)" memory_backed=1 power=1; then
27+
echo "Configuring null_blk failed"
28+
return 1
29+
fi
30+
fio --verify=md5 --rw=randwrite --bs=$bs --loops=$((10**6)) \
31+
--iodepth=64 --group_reporting --sync=1 --direct=1 \
32+
--ioengine=libaio --runtime="${TIMEOUT}" --thread \
33+
--name=block-031 --filename=/dev/nullb0 \
34+
--output="${RESULTS_DIR}/block/fio-output-031.txt" \
35+
>>"$FULL"
36+
fio_status=$?
37+
rmdir /sys/kernel/config/nullb/nullb0
38+
_exit_null_blk
39+
case $fio_status in
40+
0) echo "Passed";;
41+
*) echo "Failed (fio status = $fio_status)";;
42+
esac
43+
}

tests/block/031.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Passed

0 commit comments

Comments
 (0)