[Bug 289711] NFS4 access to symlinks is very slow

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 20 Sep 2025 11:17:51 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289711

            Bug ID: 289711
           Summary: NFS4 access to symlinks is very slow
           Product: Base System
           Version: 14.3-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: pmc@citylink.dinoex.sub.org

when building the port audio/ardour, it runs a find over the staging area. Code
location (as of now) is here:

   https://cgit.freebsd.org/ports/tree/audio/ardour/Makefile#n90

This basically finds and then strips a few dozen library files.
/usr/ports is on NFS. And this command does not return in linear time.

Some of the libary files are symlinks. And these need 137 to 259
seconds to access (until the process eventually stalls entirely).

Also, during these seconds the respective directory is not accessible;
apparently there is some deadlock.

Communication is host to guest locally. Systems are mostly idle.


Client side settings:

# /etc/fstab:
192.168.97.17:/var/sysup/mnt/tmp.6.30322 /usr/ports nfs
nfsv4,readahead=1,rw,async 0 0

nfs_client_enable="YES"
nfs_access_cache="600"
nfs_bufpackets="32"
nfscbd_enable="YES"


Server side settings:

nfs_server_enable="YES"
nfs_server_flags="-u -t --minthreads 2 --maxthreads 20 -h 192.168.97.17 -h
fd00::123"
nfsv4_server_enable="YES"

vfs.nfsd.enable_stringtouid=1
vfs.nfsd.issue_delegations=1


Testing shows this:

# for i in $FILES
do
echo $i
time strip $i
done
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libptformat.so.0
      137.79 real         0.01 user         1.50 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libaaf.so
      259.95 real         0.00 user         7.08 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/vamp/libardourvamppyin.so
      136.47 real         0.00 user         0.48 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libwaveview.so.0.0.0
        0.05 real         0.00 user         0.01 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libardour.so.3.0.0
        1.00 real         0.00 user         0.47 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libpbd.so
      136.55 real         0.00 user         0.51 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libpbd.so.4.1.0
        0.10 real         0.00 user         0.01 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libwidgets.so
      136.62 real         0.00 user         0.53 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libwidgets.so.0
        0.18 real         0.01 user         0.02 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libaudiographer.so.0
      136.50 real         0.01 user         0.49 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/engines/libclearlooks.so
        0.04 real         0.00 user         0.00 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libtemporal.so.0
      136.52 real         0.00 user         0.50 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libcanvas.so
      257.29 real         0.00 user         4.90 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libgtkmm2ext.so.0.8.3
        0.49 real         0.00 user         0.41 sys
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libwidgets.so
      271.81 real         0.00 user        20.73 sys


Interesting here is the accumulation of delays around certain values, like
137 or 258.


Maybe this gives a bit more of a clue:

# ps axlww | grep 50895 ; procstat -kk 50895
  0 50895 50894 11  24  0 23936  8844 nfstry   D+    1      0:00.18
/usr/bin/strip
/usr/ports/audio/ardour/work/stage/usr/local/lib/ardour8/libpbd.so

  PID    TID COMM                TDNAME              KSTACK                     
50895 100713 strip               -                   mi_switch+0xc3
sleepq_timedwait+0x2f _sleep+0x1e5 nfs_catnap+0x43 newnfs_request+0x14c3
nfscl_request+0x5c nfsrpc_rename+0x445 nfs_renamerpc+0x67 nfs_sillyrename+0xf9
nfs_remove+0x111 vop_sigdefer+0x2f VOP_REMOVE_APV+0x2d kern_funlinkat+0x40f
sys_unlink+0x28 filemon_wrapper_unlink+0x13 amd64_syscall+0x118
fast_syscall_common+0xf8

-- 
You are receiving this mail because:
You are the assignee for the bug.