forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for ARC sysctls ignored at runtime
This change leverage module_param_call() to run arc_tuning_update() immediately after the ARC tunable has been updated as suggested in cffa837 code review. A simple test case is added to the ZFS Test Suite to prevent future regressions in functionality. This is a backport of openzfs#9489 provided from: openzfs#9776 (comment) Signed-off-by: loli10K <[email protected]>
- Loading branch information
1 parent
6f98f60
commit e102aee
Showing
5 changed files
with
124 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/zfs-tests/tests/functional/arc/arcstats_runtime_tuning.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/ksh -p | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
|
||
# | ||
# Copyright 2019, loli10K <[email protected]>. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/perf/perf.shlib | ||
|
||
function cleanup | ||
{ | ||
# Set tunables to their recorded actual size and then to their original | ||
# value: this works for previously unconfigured tunables. | ||
log_must set_tunable64 zfs_arc_min "$MINSIZE" | ||
log_must set_tunable64 zfs_arc_min "$ZFS_ARC_MIN" | ||
log_must set_tunable64 zfs_arc_max "$MAXSIZE" | ||
log_must set_tunable64 zfs_arc_max "$ZFS_ARC_MAX" | ||
} | ||
|
||
log_onexit cleanup | ||
|
||
ZFS_ARC_MAX="$(get_tunable zfs_arc_max)" | ||
ZFS_ARC_MIN="$(get_tunable zfs_arc_min)" | ||
MINSIZE="$(get_min_arc_size)" | ||
MAXSIZE="$(get_max_arc_size)" | ||
|
||
log_assert "ARC tunables should be updated dynamically" | ||
|
||
for size in $((MAXSIZE/4)) $((MAXSIZE/3)) $((MAXSIZE/2)) $MAXSIZE; do | ||
log_must set_tunable64 zfs_arc_max "$size" | ||
log_must test "$(get_max_arc_size)" == "$size" | ||
log_must set_tunable64 zfs_arc_min "$size" | ||
log_must test "$(get_min_arc_size)" == "$size" | ||
done | ||
|
||
log_pass "ARC tunables can be updated dynamically" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters