diff options
author | smh <smh@FreeBSD.org> | 2016-07-06 23:49:19 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-07-06 23:49:19 +0000 |
commit | f10b37d27b405224e46fd9ee850f64f2e325b166 (patch) | |
tree | cec64c7d9cfada3aef5f463916a94b9eed82499c /sys/cddl | |
parent | fe840b6ea6fb698a59e56500e76052cce58591f0 (diff) | |
download | FreeBSD-src-f10b37d27b405224e46fd9ee850f64f2e325b166.zip FreeBSD-src-f10b37d27b405224e46fd9ee850f64f2e325b166.tar.gz |
Fix ZFS ARC min / max tunable
Due to ARC initial configuration not being done and kmem information
not being available we need to blindly set zfs_arc_max and zfs_arc_min
when configured via the tunable.
This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by
r302265.
Approved by: re(gjb)
MFC after: 1 week
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 19a1666..31a8c65 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -919,6 +919,12 @@ sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_ARGS) if (err != 0 || req->newptr == NULL) return (err); + if (zfs_arc_max == 0) { + /* Loader tunable so blindly set */ + zfs_arc_max = val; + return (0); + } + if (val < arc_abs_min || val > kmem_size()) return (EINVAL); if (val < arc_c_min) @@ -956,6 +962,12 @@ sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_ARGS) if (err != 0 || req->newptr == NULL) return (err); + if (zfs_arc_min == 0) { + /* Loader tunable so blindly set */ + zfs_arc_min = val; + return (0); + } + if (val < arc_abs_min || val > arc_c_max) return (EINVAL); |