From: Bart Van Assche <bvanassche@acm.org>
To: Omar Sandoval <osandov@fb.com>
Cc: linux-block@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
John Garry <john.garry@huawei.com>,
Don Brace <don.brace@microsemi.com>,
Douglas Gilbert <dgilbert@interlog.com>
Subject: [PATCH blktests] tests/block/031: Add a test for sharing a tag set across hardware queues
Date: Sun, 28 Mar 2021 16:12:09 -0700 [thread overview]
Message-ID: <20210328231210.3707-1-bvanassche@acm.org> (raw)
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 <john.garry@huawei.com>
Cc: Don Brace<don.brace@microsemi.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
tests/block/031 | 43 +++++++++++++++++++++++++++++++++++++++++++
tests/block/031.out | 1 +
2 files changed, 44 insertions(+)
create mode 100755 tests/block/031
create mode 100644 tests/block/031.out
diff --git a/tests/block/031 b/tests/block/031
new file mode 100755
index 000000000000..7940f9fa1114
--- /dev/null
+++ b/tests/block/031
@@ -0,0 +1,43 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright 2021 Google LLC
+#
+# Test support for sharing a tag set across hardware queues ("host tag set").
+
+. tests/block/rc
+. common/null_blk
+
+DESCRIPTION="test host tagset support"
+TIMED=1
+
+requires() {
+ _have_null_blk && _have_module_param null_blk shared_tag_bitmap
+}
+
+test() {
+ local fio_status bs=512
+
+ : "${TIMEOUT:=30}"
+ if ! _init_null_blk nr_devices=0 queue_mode=2 shared_tag_bitmap=1; then
+ echo "Loading null_blk failed"
+ return 1
+ fi
+ if ! _configure_null_blk nullb0 completion_nsec=0 blocksize=$bs size=1\
+ submit_queues="$(nproc)" memory_backed=1 power=1; then
+ echo "Configuring null_blk failed"
+ return 1
+ fi
+ fio --verify=md5 --rw=randwrite --bs=$bs --loops=$((10**6)) \
+ --iodepth=64 --group_reporting --sync=1 --direct=1 \
+ --ioengine=libaio --runtime="${TIMEOUT}" --thread \
+ --name=block-031 --filename=/dev/nullb0 \
+ --output="${RESULTS_DIR}/block/fio-output-031.txt" \
+ >>"$FULL"
+ fio_status=$?
+ rmdir /sys/kernel/config/nullb/nullb0
+ _exit_null_blk
+ case $fio_status in
+ 0) echo "Passed";;
+ *) echo "Failed (fio status = $fio_status)";;
+ esac
+}
diff --git a/tests/block/031.out b/tests/block/031.out
new file mode 100644
index 000000000000..863339fb8ced
--- /dev/null
+++ b/tests/block/031.out
@@ -0,0 +1 @@
+Passed
next reply other threads:[~2021-03-28 23:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-28 23:12 Bart Van Assche [this message]
2021-03-28 23:12 ` [PATCH blktests v2] rdma: Use rdma link instead of /sys/class/infiniband/*/parent Bart Van Assche
2021-03-28 23:41 ` Bart Van Assche
2021-04-22 17:48 ` [PATCH blktests] tests/block/031: Add a test for sharing a tag set across hardware queues Omar Sandoval
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210328231210.3707-1-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=dgilbert@interlog.com \
--cc=don.brace@microsemi.com \
--cc=john.garry@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).