summaryrefslogtreecommitdiffstats
path: root/module/os/linux
diff options
context:
space:
mode:
authorloli10K <[email protected]>2019-10-27 00:22:19 +0200
committerBrian Behlendorf <[email protected]>2019-10-26 15:22:19 -0700
commite35704647e84c62c6a6017ead0b66b446010e4ff (patch)
treeda45b7d329f00cf2aaa2b6e0420a933e1d6784fd /module/os/linux
parent6963414d7049b52047982fd94bfc16522bc5c26c (diff)
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 cffa8372 code review. A simple test case is added to the ZFS Test Suite to prevent future regressions in functionality. Reviewed-by: Matt Macy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #9487 Closes #9489
Diffstat (limited to 'module/os/linux')
-rw-r--r--module/os/linux/zfs/arc_os.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/module/os/linux/zfs/arc_os.c b/module/os/linux/zfs/arc_os.c
index 696f671ab..c9db31096 100644
--- a/module/os/linux/zfs/arc_os.c
+++ b/module/os/linux/zfs/arc_os.c
@@ -357,6 +357,34 @@ arc_lowmem_fini(void)
{
spl_unregister_shrinker(&arc_shrinker);
}
+
+int
+param_set_arc_long(const char *buf, zfs_kernel_param_t *kp)
+{
+ int error;
+
+ error = param_set_long(buf, kp);
+ if (error < 0)
+ return (SET_ERROR(error));
+
+ arc_tuning_update();
+
+ return (0);
+}
+
+int
+param_set_arc_int(const char *buf, zfs_kernel_param_t *kp)
+{
+ int error;
+
+ error = param_set_int(buf, kp);
+ if (error < 0)
+ return (SET_ERROR(error));
+
+ arc_tuning_update();
+
+ return (0);
+}
#else /* _KERNEL */
int64_t
arc_available_memory(void)