mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
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:
committed by
Brian Behlendorf
parent
6963414d70
commit
e35704647e
@@ -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 */
|
||||
|
||||
@@ -611,6 +611,10 @@ extern void arc_prune_async(int64_t);
|
||||
extern int arc_memory_throttle(spa_t *spa, uint64_t reserve, uint64_t txg);
|
||||
extern uint64_t arc_free_memory(void);
|
||||
extern int64_t arc_available_memory(void);
|
||||
extern void arc_tuning_update(void);
|
||||
|
||||
extern int param_set_arc_long(const char *buf, zfs_kernel_param_t *kp);
|
||||
extern int param_set_arc_int(const char *buf, zfs_kernel_param_t *kp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -198,7 +198,13 @@ extern int aok;
|
||||
/*
|
||||
* Tunables.
|
||||
*/
|
||||
typedef struct zfs_kernel_param {
|
||||
const char *name; /* unused stub */
|
||||
} zfs_kernel_param_t;
|
||||
|
||||
#define ZFS_MODULE_PARAM(scope_prefix, name_prefix, name, type, perm, desc)
|
||||
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, setfunc, \
|
||||
getfunc, perm, desc)
|
||||
|
||||
/*
|
||||
* Exported symbols
|
||||
|
||||
Reference in New Issue
Block a user