From 7b232e93548a187beb5490314dad181f9ce6b17c Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Fri, 26 Jun 2020 18:05:28 -0700 Subject: arcstat: add 'avail', fix 'free' The meaning of the `free` field is currently `zfs_arc_sys_free`, which is the target amount of memory to leave free for the system, and is constant after booting. This commit changes the meaning of `free` to arc_free_memory(), the amount of memory that the ARC considers to be free. It also adds a new arcstat field `avail`, which tracks `arc_available_memory()`. Since `avail` can be negative, it also updates the arcstat script to pretty-print negative values. example output: $ arcstat -f time,miss,arcsz,c,grow,need,free,avail 1 time miss arcsz c grow need free avail 15:03:02 39K 114G 114G 0 0 2.4G 407M 15:03:03 42K 114G 114G 0 0 2.1G 120M 15:03:04 40K 114G 114G 0 0 1.8G -177M 15:03:05 24K 113G 112G 0 0 1.7G -269M 15:03:06 29K 111G 110G 0 0 1.6G -385M 15:03:07 27K 110G 108G 0 0 1.4G -535M 15:03:08 13K 108G 108G 0 0 2.2G 239M 15:03:09 33K 107G 107G 0 0 1.3G -639M 15:03:10 16K 105G 102G 0 0 2.6G 704M 15:03:11 7.2K 102G 102G 0 0 5.1G 3.1G 15:03:12 42K 103G 102G 0 0 4.8G 2.8G Reviewed-by: George Melikov Reviewed-by: Pavel Zakharov Reviewed-by: Tony Nguyen Signed-off-by: Matthew Ahrens Closes #10494 --- man/man1/arcstat.1 | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'man/man1') diff --git a/man/man1/arcstat.1 b/man/man1/arcstat.1 index 6dcc39b67..9113b76af 100644 --- a/man/man1/arcstat.1 +++ b/man/man1/arcstat.1 @@ -236,12 +236,21 @@ Time .sp .ne 2 .na -\fBarcsz \fR +\fBsize \fR .ad .RS 14n ARC size .RE +.sp +.ne 2 +.na +\fBarcsz \fR +.ad +.RS 14n +Alias for \fBsize\fR +.RE + .sp .ne 2 .na @@ -392,7 +401,18 @@ ARC reclaim needed \fBfree \fR .ad .RS 14n -ARC free memory +The ARC's idea of how much free memory there is, which includes evictable memory in the page cache. +Since the ARC tries to keep \fBavail\fR above zero, \fBavail\fR is usually more instructive to observe than \fBfree\fR. +.RE + +.sp +.ne 2 +.na +\fBavail \fR +.ad +.RS 14n +The ARC's idea of how much free memory is available to it, which is a bit less than \fBfree\fR. +May temporarily be negative, in which case the ARC will reduce the target size \fBc\fR. .RE .\" -- cgit v1.2.3