Add vdev property to disable vdev scheduler

Added vdev property to disable the vdev scheduler.
The intention behind this property is to improve IOPS
performance when using o_direct.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: MigeljanImeri <ImeriMigel@gmail.com>
Closes #17358
This commit is contained in:
MigeljanImeri
2026-02-23 12:34:33 -05:00
committed by GitHub
parent d2f5cb3a50
commit 4975430cf5
14 changed files with 206 additions and 2 deletions
+1 -1
View File
@@ -564,7 +564,7 @@ tags = ['functional', 'cli_root', 'zpool_scrub']
tests = ['zpool_set_001_pos', 'zpool_set_002_neg', 'zpool_set_003_neg',
'zpool_set_ashift', 'zpool_set_features', 'vdev_set_001_pos',
'user_property_001_pos', 'user_property_002_neg',
'zpool_set_clear_userprop']
'zpool_set_clear_userprop','vdev_set_scheduler']
tags = ['functional', 'cli_root', 'zpool_set']
[tests/functional/cli_root/zpool_split]
+1
View File
@@ -1274,6 +1274,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
functional/cli_root/zpool_set/setup.ksh \
functional/cli_root/zpool/setup.ksh \
functional/cli_root/zpool_set/vdev_set_001_pos.ksh \
functional/cli_root/zpool_set/vdev_set_scheduler.ksh \
functional/cli_root/zpool_set/zpool_set_common.kshlib \
functional/cli_root/zpool_set/zpool_set_001_pos.ksh \
functional/cli_root/zpool_set/zpool_set_002_neg.ksh \
@@ -77,4 +77,5 @@ typeset -a properties=(
trim_support
trim_errors
slow_ios
scheduler
)
@@ -0,0 +1,93 @@
#!/bin/ksh -p
# SPDX-License-Identifier: CDDL-1.0
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or https://opensource.org/licenses/CDDL-1.0.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2025 by Triad National Security, LLC.
#
. $STF_SUITE/include/libtest.shlib
#
# DESCRIPTION:
# Setting vdev scheduler property while reading from vdev should not cause panic.
#
# STRATEGY:
# 1. Create a zpool
# 2. Write a file to the pool.
# 3. Start reading from file, while also setting the scheduler property.
#
verify_runnable "global"
command -v fio > /dev/null || log_unsupported "fio missing"
function set_scheduler
{
for i in auto on off ; do
sleep 0.1
zpool set scheduler=$i $TESTPOOL1 $FILEDEV
done
}
function cleanup
{
destroy_pool $TESTPOOL1
log_must rm -f $FILEDEV
}
log_assert "Toggling vdev scheduler property while reading from vdev should not cause panic"
log_onexit cleanup
# 1. Create a pool
FILEDEV="$TEST_BASE_DIR/filedev.$$"
log_must truncate -s $(($MINVDEVSIZE * 2)) $FILEDEV
create_pool $TESTPOOL1 $FILEDEV
mntpnt=$(get_prop mountpoint $TESTPOOL1)
# 2. Write a file to the pool, while also setting the scheduler property.
log_must eval "fio --filename=$mntpnt/foobar --name=write-file \
--rw=write --size=$MINVDEVSIZE --bs=128k --numjobs=1 --direct=1 \
--ioengine=sync --time_based --runtime=2 &"
ITERATIONS=4
for i in $(seq $ITERATIONS); do
log_must set_scheduler
done;
wait
# 3. Starting reading from file, while also setting the scheduler property.
log_must eval "fio --filename=$mntpnt/foobar --name=read-file \
--rw=read --size=$MINVDEVSIZE --bs=128k --numjobs=1 --direct=1 \
--ioengine=sync --time_based --runtime=2 &"
for i in $(seq $ITERATIONS); do
log_must set_scheduler
done;
wait
log_pass "Setting vdev scheduler property while reading from vdev does not cause panic"