Re: 'df' uninterruptible (kern_getfsstat -> vfs_busy -> sleep)

Konstantin Belousov <[email protected]> Mon, 27 Jul 2026 16:46:38 +0300
Newsgroups gmane.os.freebsd.devel.file-systems
Message-ID <[email protected]>
On Mon, Jul 27, 2026 at 03:17:11PM +0200, Peter Eriksson wrote:
> I just noticed (FreeBSD 15.1) that it seems that df is uninterruptible in the kernel if vfs_busy() is waiting for some lock/sleeping. 
> 
> Output from procstat:
> 
> 54468 105116 df                  -                   mi_switch+0xbc _sleep+0x19e vfs_busy+0x203 kern_getfsstat+0x1e8 sys_getfsstat+0x22 amd64_syscall+0x126 fast_syscall_common+0xf8 
> 
> 
> I’m running a “zpool destroy” on a pretty large ZFS spool which is taking some time so it’s probably waiting for some internal lock, but I don’t see why df/kern_getfsstat has to uninterruptible?
> 
> (I originally did “zfs destroy -t $POOL” then after some time aborted that an run “zpool destroy $POOL” instead so there are probably a lot of internal zfs deletions running, “zpool get freeing $POOL” gives that there are around 10TB being deleted.)
> 

Yes, this is reasonable, and I wanted to be able to interrupt the busy
for some time, but forget about it.

Try https://reviews.freebsd.org/D58477