Re: possible optimization in nfsd_set_fh_dentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2025-08-08 at 17:22 +0000, Charles Hedrick wrote:
> In the past we've seen high CPU in cases where we had a very large number of subdirectories in a directory. This was due to the cost of reconnecting them.
> 
> In a patch March 9 in Centos 9, "ovl: do not try to reconnect a disconnected origin dentry", an optimization was made to avoid this, but it was only implemented for overlay. Would it make sense to do the same thing in nfsd?
> 
> in nfsfs.c, it would change the call to exportfs_decode_fh_raw so that when to pass
> exp->ex_flags & NFSEXP_NOSUBTREECHECK ? NULL : nfsd_acceptable, since nfsd_acceptable will always return true if NOSUBTREECHECK is set.

Can that function cope with a disconnected dir dentry? Note this a
little while later in the function:

        if (d_is_dir(dentry) &&
                        (dentry->d_flags & DCACHE_DISCONNECTED)) {
                printk("nfsd: find_fh_dentry returned a DISCONNECTED directory: %pd2\n",
                                dentry);
        }

...so I imagine such a change will make that printk pop a lot more.
-- 
Jeff Layton <jlayton@xxxxxxxxxx>





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux