1#!/bin/ksh -p 2# 3# This file and its contents are supplied under the terms of the 4# Common Development and Distribution License ("CDDL"), version 1.0. 5# You may only use this file in accordance with the terms of version 6# 1.0 of the CDDL. 7# 8# A full copy of the text of the CDDL should have accompanied this 9# source. A copy of the CDDL is also available via the Internet at 10# http://www.illumos.org/license/CDDL. 11# 12 13# 14# Copyright 2019, loli10K <ezomori.nozomu@gmail.com>. All rights reserved. 15# 16 17. $STF_SUITE/include/libtest.shlib 18. $STF_SUITE/tests/perf/perf.shlib 19 20function cleanup 21{ 22 # Set tunables to their recorded actual size and then to their original 23 # value: this works for previously unconfigured tunables. 24 log_must set_tunable64 ARC_MIN "$MINSIZE" 25 log_must set_tunable64 ARC_MIN "$ZFS_ARC_MIN" 26 log_must set_tunable64 ARC_MAX "$MAXSIZE" 27 log_must set_tunable64 ARC_MAX "$ZFS_ARC_MAX" 28} 29 30log_onexit cleanup 31 32ZFS_ARC_MAX="$(get_tunable ARC_MAX)" 33ZFS_ARC_MIN="$(get_tunable ARC_MIN)" 34MINSIZE="$(get_min_arc_size)" 35MAXSIZE="$(get_max_arc_size)" 36 37log_assert "ARC tunables should be updated dynamically" 38 39for size in $((MAXSIZE/4)) $((MAXSIZE/3)) $((MAXSIZE/2)) $MAXSIZE; do 40 log_must set_tunable64 ARC_MAX "$size" 41 log_must test "$(get_max_arc_size)" == "$size" 42 log_must set_tunable64 ARC_MIN "$size" 43 log_must test "$(get_min_arc_size)" == "$size" 44done 45 46log_pass "ARC tunables can be updated dynamically" 47