Anything depending on the output of 'sysctl -a' or 'sysctl kstat.zfs.misc.dbufs' will effectively hang 'forever' on my system, and reportedly others too. The system in question is running a poudriere jail, which builds a few hundred packages every night. System is a 8-core 256GB system; resource congestion is not an issue. E.g. Puppet will be useless on this system, since 'sysctl -a' is run during fact collection. Suggestion: Do not gather/output kstat.zfs.misc.dbufs unless specifically requested.
Example output: # time sysctl kstat.zfs.misc.dbufs | wc 0 0 0 186084 6885040 54442005 real 4m49.726s user 0m0.352s sys 4m49.402s
Is anything happening here? This breaks various applications that rely on sysctl -a output, including Puppet (configuration management).
This is going to be fixed, but it is waiting on some other things that need to land first.
This kstat will be a lot faster soon, though not hidden yet. https://github.com/openzfs/zfs/pull/10993
WIP to enable skipped kstats to remain discoverable here: https://reviews.freebsd.org/D26560 After that is finished and MFC'd I'll make it so the root kstat node is skipped unless explicitly requested. In the meantime, the change in the pull request in #4 should make things significantly faster.
A commit references this bug: Author: freqlabs Date: Sat Oct 24 16:25:53 UTC 2020 New revision: 367010 URL: https://svnweb.freebsd.org/changeset/base/367010 Log: 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. Changes: head/sys/contrib/openzfs/module/os/freebsd/spl/spl_kstat.c