]> git.proxmox.com Git - mirror_zfs.git/commitdiff
FreeBSD: 11.x arc_stats compatibility
authorMatthew Macy <mmacy@freebsd.org>
Thu, 20 Aug 2020 17:55:02 +0000 (10:55 -0700)
committerGitHub <noreply@github.com>
Thu, 20 Aug 2020 17:55:02 +0000 (10:55 -0700)
Removing other_size from arc_stats breaks top in 11.x jails
running on HEAD.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10745

include/sys/arc_impl.h
module/Makefile.bsd
module/zfs/arc.c

index 9051fd2bf0d0a463a14a1ae60a783556cb578a8b..c5061695d94425013718490cf7a2ac8c4155f00d 100644 (file)
@@ -619,6 +619,13 @@ typedef struct arc_stats {
         * Not updated directly; only synced in arc_kstat_update.
         */
        kstat_named_t arcstat_bonus_size;
+#if defined(COMPAT_FREEBSD11)
+       /*
+        * Sum of the previous three counters, provided for compatibility.
+        */
+       kstat_named_t arcstat_other_size;
+#endif
+
        /*
         * Total number of bytes consumed by ARC buffers residing in the
         * arc_anon state. This includes *all* buffers in the arc_anon
index d0b4a5bd6e21d42e88e574a3a4bbc1beb8cb653b..53b97dafd9e9c98af736116bffeee2b91da9189c 100644 (file)
@@ -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
index ff2621194dca87da804b2dcdc91ec86888c422f9..fc62af7c760461c0ea57b2ce44ea8e78f5320cbd 100644 (file)
@@ -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) =