-
Notifications
You must be signed in to change notification settings - Fork 580
ZFS ARC stats for Linux, FreeBSD, Darwin, & Solaris #920
base: master
Are you sure you want to change the base?
Conversation
Could have resulted in a buffer overflow if the FreeBSD kernel returned more bytes than expected.
New meter displays same ARC stats as FreeBSD top(1). Can be extended to other platforms that support ZFS. Pulling kstat.zfs.misc.arcstats.c_max as the meter total, so the meter has a meaningful value to work up to. The Text meter displays, first, the maximum ARC size (Meter.total), then second, the total ARC used, using the difference between Meter.maxItems and Meter.curItems to "hide" the used value from the Bar and Graph drawing functions by using an index in Meter.values[] that is beyond curItems - 1, but less than maxItems - 1.
If no pools are imported (ARC size == 0) or the ZFS module is not in the kernel (/proc/spl/kstat/zfs/arcstats does not exist), then the Meter reports "Unavailable".
Darwin and FreeBSD export zfs kstats through the same APIs, so moving functions into a common file.
...I love it when my to-do list gets shorter on its own. Thank you! |
Works great on OpenIndiana 2019.04 in global and non-global zones. We will ship it via sources from @ninefathom soon. Thanks, @overhacked! |
FYI: #937. |
Should be reasonably simple. I think visually it would need to be a different meter type. @ninefathom, will you still merge if I add another "ZFS ARC Compression" meter type? |
Sure would.
…On Fri, Aug 23, 2019 at 2:29 PM Ross Williams ***@***.***> wrote:
Should be reasonably simple. I think visually it would need to be a
different meter type. @ninefathom <https://github.com/ninefathom>, will
you still merge if I add another "ZFS ARC Compression" meter type?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#920?email_source=notifications&email_token=AANHROE67GG2XX2EEXFI6X3QGAT75A5CNFSM4H6SUYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5A7QMI#issuecomment-524417073>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANHROHVX53SJHL4TTWDTO3QGAT75ANCNFSM4H6SUYZQ>
.
|
openzfs_sysctl_init() now returns void instead of int. The ZfsArcStats->enabled flag is set inside the init function now, instead of having to be set from its return value. Preparation for more flag setting in Compressed ARC commit. ZfsArcMeter_readStats() added and all Meter->values[] setting moved to it, eliminating duplicated code in {darwin,freebsd,linux,solaris}/Platform.c.
Resolving CI issues… |
Tests out on FreeBSD, Linux, OmniOS, and Darwin. |
@Mno-hime release with the compressed ARC stats in the usual place, as 220-sunos_11-p3 |
Closes #937 |
does this separate the ZFS ARC size as |
@despair86, I didn't mess with the code that calculates other types of memory usage in this PR, but I agree that it is more useful to have htop report ARC as cache usage. That code already exists for the FreeBSD platform but not for any other platforms. I could add the tweaking of reported usage for Linux and Solaris/Illumos as a part of this PR. @ninefathom, any feedback? Would you rather see those changes in a separate PR, maybe an expansion of #976? |
Merged here: htop-dev/htop@9a55efc |
Added a new
Meter
type that displays ZFS ARC stats like FreeBSD's top(1).Supported on FreeBSD, Darwin/OS X/macOS, and Linux. FreeBSD & Darwin are nearly identical. Doesn't break or affect other OSes, as it is only included in
Platform_meterTypes
for supported OSes. There is also a potential buffer overflow bug fix in the first commit.