statvfs (statvfs64) is unacceptably slow while large files are beeing freed in the background on logging UFS.
Tests I've performed on a modest x86 system shows df hanging in statvfs64 for around 15 seconds after deleting some large files while UFS is freeing the blocks.
If I mount the filesystem "nologging", it takes just fractions of a second.
My tests were performed on a simple 40G UFS filesystem mounted on /mnt:
---
cd /mnt
mkfile 5g a b c
lockfs -f /mnt
rm a b c
---
In another window I ran "truss df -D /mnt".
Before the rm:
spiff:~ (361)> truss -D df /mnt
...
0.0004 resolvepath("/mnt", "/mnt", 1024) = 4
0.0003 statvfs64("/mnt", 0x0804725C) = 0
...
This statvfs64 took just 300µs.
After the rm:
spiff:~ (362)> truss -D df /mnt
...
0.0003 resolvepath("/mnt", "/mnt", 1024) = 4
14.9443 statvfs64("/mnt", 0x0804725C) = 0
...
This statvfs64 took almost 15 seconds.