diff options
author | Matthew Macy <[email protected]> | 2020-08-20 10:55:02 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-20 10:55:02 -0700 |
commit | 1c2725a157d1af79d73bbe980ff8db01086fd1e8 (patch) | |
tree | f78109c4880b58b0e85e8fb3ab5ec49a82f5b331 /module | |
parent | 10b3c7f5e424f54b3ba82dbf1600d866e64ec0a0 (diff) |
FreeBSD: 11.x arc_stats compatibility
Removing other_size from arc_stats breaks top in 11.x jails
running on HEAD.
Reviewed-by: Ryan Moeller <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #10745
Diffstat (limited to 'module')
-rw-r--r-- | module/Makefile.bsd | 2 | ||||
-rw-r--r-- | module/zfs/arc.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/module/Makefile.bsd b/module/Makefile.bsd index d0b4a5bd6..53b97dafd 100644 --- a/module/Makefile.bsd +++ b/module/Makefile.bsd @@ -33,7 +33,7 @@ CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 \ -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ - -D_SYS_VMEM_H_ -DKDTRACE_HOOKS -DSMP -DHAVE_KSID + -D_SYS_VMEM_H_ -DKDTRACE_HOOKS -DSMP -DHAVE_KSID -DCOMPAT_FREEBSD11 .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_SSSE3 diff --git a/module/zfs/arc.c b/module/zfs/arc.c index ff2621194..fc62af7c7 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -512,6 +512,9 @@ arc_stats_t arc_stats = { { "dbuf_size", KSTAT_DATA_UINT64 }, { "dnode_size", KSTAT_DATA_UINT64 }, { "bonus_size", KSTAT_DATA_UINT64 }, +#if defined(COMPAT_FREEBSD11) + { "other_size", KSTAT_DATA_UINT64 }, +#endif { "anon_size", KSTAT_DATA_UINT64 }, { "anon_evictable_data", KSTAT_DATA_UINT64 }, { "anon_evictable_metadata", KSTAT_DATA_UINT64 }, @@ -7121,6 +7124,11 @@ arc_kstat_update(kstat_t *ksp, int rw) ARCSTAT(arcstat_hdr_size) = aggsum_value(&astat_hdr_size); ARCSTAT(arcstat_l2_hdr_size) = aggsum_value(&astat_l2_hdr_size); ARCSTAT(arcstat_dbuf_size) = aggsum_value(&astat_dbuf_size); +#if defined(COMPAT_FREEBSD11) + ARCSTAT(arcstat_other_size) = aggsum_value(&astat_bonus_size) + + aggsum_value(&astat_dnode_size) + + aggsum_value(&astat_dbuf_size); +#endif ARCSTAT(arcstat_dnode_size) = aggsum_value(&astat_dnode_size); ARCSTAT(arcstat_bonus_size) = aggsum_value(&astat_bonus_size); ARCSTAT(arcstat_abd_chunk_waste_size) = |