From 6f73d02168ea4d4c27e95d3f23df7221c7321e07 Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Thu, 9 Jun 2022 07:10:38 -0700 Subject: zvol: Support blk-mq for better performance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for the kernel's block multiqueue (blk-mq) interface in the zvol block driver. blk-mq creates multiple request queues on different CPUs rather than having a single request queue. This can improve zvol performance with multithreaded reads/writes. This implementation uses the blk-mq interfaces on 4.13 or newer kernels. Building against older kernels will fall back to the older BIO interfaces. Note that you must set the `zvol_use_blk_mq` module param to enable the blk-mq API. It is disabled by default. In addition, this commit lets the zvol blk-mq layer process whole `struct request` IOs at a time, rather than breaking them down into their individual BIOs. This reduces dbuf lock contention and overhead versus the legacy zvol submit_bio() codepath. sequential dd to one zvol, 8k volblocksize, no O_DIRECT: legacy submit_bio() 292MB/s write 453MB/s read this commit 453MB/s write 885MB/s read It also introduces a new `zvol_blk_mq_chunks_per_thread` module parameter. This parameter represents how many volblocksize'd chunks to process per each zvol thread. It can be used to tune your zvols for better read vs write performance (higher values favor write, lower favor read). Reviewed-by: Brian Behlendorf Reviewed-by: Ahelenia ZiemiaƄska Reviewed-by: Tony Nguyen Signed-off-by: Tony Hutter Closes #13148 Issue #12483 --- tests/runfiles/common.run | 6 +++++- tests/runfiles/linux.run | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/runfiles') diff --git a/tests/runfiles/common.run b/tests/runfiles/common.run index 243221598..89ee0d3cb 100644 --- a/tests/runfiles/common.run +++ b/tests/runfiles/common.run @@ -937,9 +937,13 @@ tags = ['functional', 'zvol', 'zvol_cli'] [tests/functional/zvol/zvol_misc] tests = ['zvol_misc_002_pos', 'zvol_misc_hierarchy', 'zvol_misc_rename_inuse', - 'zvol_misc_snapdev', 'zvol_misc_volmode', 'zvol_misc_zil'] + 'zvol_misc_snapdev', 'zvol_misc_trim', 'zvol_misc_volmode', 'zvol_misc_zil'] tags = ['functional', 'zvol', 'zvol_misc'] +[tests/functional/zvol/zvol_stress] +tests = ['zvol_stress'] +tags = ['functional', 'zvol', 'zvol_stress'] + [tests/functional/zvol/zvol_swap] tests = ['zvol_swap_001_pos', 'zvol_swap_002_pos', 'zvol_swap_004_pos'] tags = ['functional', 'zvol', 'zvol_swap'] diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index 3985da146..fa71f412b 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -184,3 +184,8 @@ tags = ['functional', 'user_namespace'] tests = ['groupspace_001_pos', 'groupspace_002_pos', 'groupspace_003_pos', 'userquota_013_pos', 'userspace_003_pos'] tags = ['functional', 'userquota'] + +[tests/functional/zvol/zvol_misc:Linux] +tests = ['zvol_misc_fua'] +tags = ['functional', 'zvol', 'zvol_misc'] + -- cgit v1.2.3