Skip to content

Commit 5c810ac

Browse files
author
Ryan Moeller
authored
FreeBSD: Skip RAW kstat sysctls by default
These 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 In FreeBSD 13, sysctl(8) has been updated to still list the names/description/type of skipped sysctls so they are still discoverable. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Mateusz Guzik <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11099
1 parent 01a65c5 commit 5c810ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

module/os/freebsd/spl/spl_kstat.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,14 +475,14 @@ kstat_install(kstat_t *ksp)
475475
if (ksp->ks_raw_ops.data) {
476476
root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
477477
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
478-
OID_AUTO, ksp->ks_name,
479-
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
478+
OID_AUTO, ksp->ks_name, CTLTYPE_STRING | CTLFLAG_RD
479+
| CTLFLAG_MPSAFE | CTLFLAG_SKIP,
480480
ksp, 0, kstat_sysctl_raw, "A", ksp->ks_name);
481481
} else {
482482
root = SYSCTL_ADD_PROC(&ksp->ks_sysctl_ctx,
483483
SYSCTL_CHILDREN(ksp->ks_sysctl_root),
484-
OID_AUTO, ksp->ks_name,
485-
CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE,
484+
OID_AUTO, ksp->ks_name, CTLTYPE_OPAQUE | CTLFLAG_RD
485+
| CTLFLAG_MPSAFE | CTLFLAG_SKIP,
486486
ksp, 0, kstat_sysctl_raw, "", ksp->ks_name);
487487
}
488488
break;

0 commit comments

Comments
 (0)