From b19cdab3456b361e1ef79651fe1437d8cab4de19 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Sat, 24 Oct 2020 16:25:52 +0000 Subject: [PATCH] Skip RAW kstat sysctls by default hese kstats are often expensive to compute so we want to avoid them unless specifically requested. The following kstats are affected by this change: kstat.zfs.${pool}.multihost kstat.zfs.${pool}.misc.state kstat.zfs.${pool}.txgs kstat.zfs.misc.fletcher_4_bench kstat.zfs.misc.vdev_raidz_bench kstat.zfs.misc.dbufs kstat.zfs.misc.dbgmsg PR: 249258 Reported by: mjg Reviewed by: mjg, allanjude Obtained from: https://github.com/openzfs/zfs/pull/11099 Sponsored by: iXsystems, Inc. --- sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c b/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c index b26753bacc21..6bdef466c253 100644 --- a/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c +++ b/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c @@ -475,14 +475,14 @@ kstat_install(kstat_t *ksp) if (ksp->ks_raw_ops.data) { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_STRING | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "A", ksp->ks_name); } else { root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx, SYSCTL_CHILDREN(ksp->ks_sysctl_root), - OID_AUTO, ksp->ks_name, - CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + OID_AUTO, ksp->ks_name, CTLTYPE_OPAQUE | CTLFLAG_RD + | CTLFLAG_MPSAFE | CTLFLAG_SKIP, ksp, 0, kstat_sysctl_raw, "", ksp->ks_name); } break;