[PATCH] Simple ARC stats in top

Markus Gebert markus.gebert at hostpoint.ch
Wed Jun 27 10:25:13 UTC 2012


Hi John

On 25.06.2012, at 20:43, John Baldwin wrote:

> I have some patches based on a script I got from avg@ that add some simplistic 
> ARC stats to top so that one can see how much of wired memory is set aside for 
> ARC, and how that memory is split up.  The patch is against 8-stable:
> http://www.FreeBSD.org/~jhb/patches/top_arc.patch
> 
> Sample output:
> 
> Mem: 1245M Active, 1393M Inact, 21G Wired, 309M Buf, 23G Free
> ARC: 19G Total, 1381M MRU, 17G MFU, 272K Anon, 232M Header, 442M Other
> Swap: 8192M Total, 8192M Free
> 
> Comments, etc.?

Nice feature for top, thanks!

I've tested your patch on 8.3p3. When I'm using patched top to display per-cpu statistics, the ARC line corrupts the third CPU line (CPU 2). That seems to be exactly the line top would display ARC stats on when running in normal (i.e. not -P) mode. It doesn't always happen immediately after starting top, I guess some of the ARC stats actually need to change for it to break.

Example (top -S -P):
----
last pid: 18994;  load averages:  0.00,  0.00,  0.00                                                                                                                                                   up 4+19:45:05  12:14:33
55 processes:  2 running, 52 sleeping, 1 waiting
CPU 0:  0.4% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.6% idle
CPU 1:  0.0% user,  0.0% nice,  0.0% system, 40.0% interrupt,  100% idle
CPU 2:  0.0% user,  0.0% nice,  0.0% s1009K Anon, 54M Header, 118M Other
CPU 3:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
Mem: 629M Active, 23M Inact, 2475M Wired, 1308K Cache, 748M Buf, 4786M Free
ARC: 1535M Total, 455M MRU, 906M MFU, 912K Anon, 54M Header, 118M Other
Swap: 8192M Total, 8192M Free
----


Markus



More information about the freebsd-fs mailing list