diff options
author | pjd <pjd@FreeBSD.org> | 2007-04-07 19:10:50 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-04-07 19:10:50 +0000 |
commit | 2b4a45b0fccb1dd7227a46f5ac75f99b6e116cf8 (patch) | |
tree | c6298ce4832e9c8c5cbf110fc69cbaaff9bc538f /sys | |
parent | 433a96002ab4bc72a9ca4bd299beb3c01520b482 (diff) | |
download | FreeBSD-src-2b4a45b0fccb1dd7227a46f5ac75f99b6e116cf8.zip FreeBSD-src-2b4a45b0fccb1dd7227a46f5ac75f99b6e116cf8.tar.gz |
Allow to tune maximum and minimum memory used by ARC.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 18 | ||||
-rw-r--r-- | sys/contrib/opensolaris/uts/common/fs/zfs/arc.c | 18 |
2 files changed, 26 insertions, 10 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 ca7f49b..7edee540 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -152,8 +152,15 @@ static int arc_dead; /* * These tunables are for performance analysis. */ -uint64_t zfs_arc_max; -uint64_t zfs_arc_min; +u_long zfs_arc_max; +u_long zfs_arc_min; +TUNABLE_ULONG("vfs.zfs.arc_max", &zfs_arc_max); +TUNABLE_ULONG("vfs.zfs.arc_min", &zfs_arc_min); +SYSCTL_DECL(_vfs_zfs); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RD, &zfs_arc_max, 0, + "Maximum ARC size"); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RD, &zfs_arc_min, 0, + "Minimum ARC size"); /* * Note that buffers can be on one of 5 states: @@ -2720,16 +2727,14 @@ arc_init(void) else arc_c_max = arc_c_min; arc_c_max = MAX(arc_c * 6, arc_c_max); -#ifdef notyet /* * Allow the tunables to override our calculations if they are * reasonable (ie. over 64MB) */ - if (zfs_arc_max > 64<<20 && zfs_arc_max < physmem * PAGESIZE) + if (zfs_arc_max > 64<<20 && zfs_arc_max < vm_kmem_size) arc_c_max = zfs_arc_max; if (zfs_arc_min > 64<<20 && zfs_arc_min <= arc_c_max) arc_c_min = zfs_arc_min; -#endif arc_c = arc_c_max; arc_p = (arc_c >> 1); @@ -2739,6 +2744,9 @@ arc_init(void) if (arc_c < arc_c_min) arc_c = arc_c_min; + zfs_arc_min = arc_c_min; + zfs_arc_max = arc_c_max; + arc_anon = &ARC_anon; arc_mru = &ARC_mru; arc_mru_ghost = &ARC_mru_ghost; diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c index ca7f49b..7edee540 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -152,8 +152,15 @@ static int arc_dead; /* * These tunables are for performance analysis. */ -uint64_t zfs_arc_max; -uint64_t zfs_arc_min; +u_long zfs_arc_max; +u_long zfs_arc_min; +TUNABLE_ULONG("vfs.zfs.arc_max", &zfs_arc_max); +TUNABLE_ULONG("vfs.zfs.arc_min", &zfs_arc_min); +SYSCTL_DECL(_vfs_zfs); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RD, &zfs_arc_max, 0, + "Maximum ARC size"); +SYSCTL_ULONG(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RD, &zfs_arc_min, 0, + "Minimum ARC size"); /* * Note that buffers can be on one of 5 states: @@ -2720,16 +2727,14 @@ arc_init(void) else arc_c_max = arc_c_min; arc_c_max = MAX(arc_c * 6, arc_c_max); -#ifdef notyet /* * Allow the tunables to override our calculations if they are * reasonable (ie. over 64MB) */ - if (zfs_arc_max > 64<<20 && zfs_arc_max < physmem * PAGESIZE) + if (zfs_arc_max > 64<<20 && zfs_arc_max < vm_kmem_size) arc_c_max = zfs_arc_max; if (zfs_arc_min > 64<<20 && zfs_arc_min <= arc_c_max) arc_c_min = zfs_arc_min; -#endif arc_c = arc_c_max; arc_p = (arc_c >> 1); @@ -2739,6 +2744,9 @@ arc_init(void) if (arc_c < arc_c_min) arc_c = arc_c_min; + zfs_arc_min = arc_c_min; + zfs_arc_max = arc_c_max; + arc_anon = &ARC_anon; arc_mru = &ARC_mru; arc_mru_ghost = &ARC_mru_ghost; |