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 <mmacy@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #9487  
Closes #9489
This commit is contained in:
loli10K
2019-10-27 00:22:19 +02:00
committed by Brian Behlendorf
parent 6963414d70
commit e35704647e
10 changed files with 178 additions and 42 deletions
+37 -9
View File
@@ -76,26 +76,26 @@ enum scope_prefix_types {
/*
* Declare a module parameter / sysctl node
*
* scope_prefix the part of the the sysctl / sysfs tree the node resides under
* "scope_prefix" the part of the the sysctl / sysfs tree the node resides under
* (currently a no-op on Linux)
* name_prefix the part of the variable name that will be excluded from the
* "name_prefix" the part of the variable name that will be excluded from the
* exported names on platforms with a hierarchical namespace
* name the part of the variable that will be exposed on platforms with a
* "name" the part of the variable that will be exposed on platforms with a
* hierarchical namespace, or as name_prefix ## name on Linux
* type the variable type
* perm the permissions (read/write or read only)
* desc a brief description of the option
* "type" the variable type
* "perm" the permissions (read/write or read only)
* "desc" a brief description of the option
*
* Examples:
* ZFS_MODULE_PARAM(zfs_vdev_mirror, zfs_vdev_mirror_, rotating_inc, UINT,
* ZMOD_RW, "Rotating media load increment for non-seeking I/O's");
* ZMOD_RW, "Rotating media load increment for non-seeking I/O's");
* on FreeBSD:
* vfs.zfs.vdev.mirror.rotating_inc
* on Linux:
* zfs_vdev_mirror_rotating_inc
*
* *ZFS_MODULE_PARAM(zfs, , dmu_prefetch_max, UINT, ZMOD_RW,
* "Limit one prefetch call to this size");
* ZFS_MODULE_PARAM(zfs, , dmu_prefetch_max, UINT, ZMOD_RW,
* "Limit one prefetch call to this size");
* on FreeBSD:
* vfs.zfs.dmu_prefetch_max
* on Linux:
@@ -108,5 +108,33 @@ enum scope_prefix_types {
MODULE_PARM_DESC(name_prefix ## name, desc)
/* END CSTYLED */
/*
* Declare a module parameter / sysctl node
*
* "scope_prefix" the part of the the sysctl / sysfs tree the node resides under
* (currently a no-op on Linux)
* "name_prefix" the part of the variable name that will be excluded from the
* exported names on platforms with a hierarchical namespace
* "name" the part of the variable that will be exposed on platforms with a
* hierarchical namespace, or as name_prefix ## name on Linux
* "setfunc" setter function
* "getfunc" getter function
* "perm" the permissions (read/write or read only)
* "desc" a brief description of the option
*
* Examples:
* ZFS_MODULE_PARAM_CALL(zfs_spa, spa_, slop_shift, param_set_slop_shift,
* param_get_int, ZMOD_RW, "Reserved free space in pool");
* on FreeBSD:
* vfs.zfs.spa_slop_shift
* on Linux:
* spa_slop_shift
*/
/* BEGIN CSTYLED */
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, setfunc, getfunc, perm, desc) \
CTASSERT_GLOBAL((sizeof (scope_prefix) == sizeof (enum scope_prefix_types))); \
module_param_call(name_prefix ## name, setfunc, getfunc, &name_prefix ## name, perm); \
MODULE_PARM_DESC(name_prefix ## name, desc)
/* END CSTYLED */
#endif /* _MOD_COMPAT_H */