From 488188f4f79de0fec0570bf2dfad5ffb7a5b2eaf Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 20 Sep 2015 19:53:09 +0200 Subject: [PATCH 220/257] top: Show ZFS ARC target size Obtained from: ElectroBSD --- usr.bin/top/machine.c | 6 ++++-- usr.bin/top/top.local.1 | 12 +++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 492a62ae227b..597d41fd801d 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -182,9 +182,9 @@ char *memorynames[] = { "K Free", NULL }; -int arc_stats[7]; +int arc_stats[8]; char *arcnames[] = { - "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", + "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other, ", "K Target", NULL }; @@ -557,6 +557,8 @@ get_system_info(struct system_info *si) arc_stats[4] = arc_stat + arc_stat2 >> 10; GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc_stat); arc_stats[5] = arc_stat >> 10; + GETSYSCTL("kstat.zfs.misc.arcstats.c", arc_stat); + arc_stats[6] = arc_stat >> 10; si->arc = arc_stats; } diff --git a/usr.bin/top/top.local.1 b/usr.bin/top/top.local.1 index 864ab8d65c4b..951754c83bbe 100644 --- a/usr.bin/top/top.local.1 +++ b/usr.bin/top/top.local.1 @@ -2,9 +2,9 @@ .SH "FreeBSD NOTES" .SH DESCRIPTION OF MEMORY -Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free -ARC: 2048K Total, 342K MRU, 760K MFU, 272K Anon, 232K Header, 442K Other -Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out +Mem: 387M Active, 499M Inact, 945M Wired, 8K Cache, 5528K Buf, 83M Free +ARC: 349M Total, 174M MFU, 94M MRU, 2192K Anon, 6488K Header, 73M Other, 350M Target +Swap: 2048M Total, 124M Used, 1924M Free, 6% Inuse .TP .B K: Kilobyte @@ -57,6 +57,12 @@ number of ARC bytes holding headers .TP .B Other miscellaneous ARC bytes +.TP +.B Target +ARC target size, that is the total amount of memory +the ARC considers usable for itself. If it's not equal +to the total size, the ARC will shrink or grow to reach +the target. .SS Swap Stats .TP .B Total: -- 2.11.0