Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Charles Hedrick <hedrick@rutgers.edu>
To: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: optimization for nfsd_set_fh_dentry
Date: Sun, 7 Apr 2024 13:25:33 +0000	[thread overview]
Message-ID: <PH0PR14MB549329F998F7DB972744F45FAA012@PH0PR14MB5493.namprd14.prod.outlook.com> (raw)

nfsd_set_fh_dentry is used in setfh and a number of other places. It calls exportfs_decode_fh_raw with an argument nfsd_acceptable.

That is a test that always returns 1 if NFSEXP_NOSUBTREECHECK is set.

However there is an optimization in exportfs_decode_fh_raw that skips a lot of file system stuff if NULL is passed as the test. A test that always returns 1 still triggers all the file system stuff, even though it's not needed. 

nfsd_set_fh_dentry should pass NULL to exportfs_decode_fh_raw if NFSEXP_NOSUBTREECHECK is set.

I discovered this while looking into a performance problem caused by a pathological client that was sending 40,000 RPCs/sec, almost all get 
GETATTR or ACCESS. It was causing the nfsd's to be stuck at 100% CPU by locks in file system code invoked by this unnecessary code.

(We fixed the client by mounting with NFS3 rather than NFS4. This suggests an issue with the NFS 4 client side. Unfortunately I don't have enough information to make a useful report.)




             reply	other threads:[~2024-04-07 13:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07 13:25 Charles Hedrick [this message]
2024-04-08 11:51 ` optimization for nfsd_set_fh_dentry Charles Hedrick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR14MB549329F998F7DB972744F45FAA012@PH0PR14MB5493.namprd14.prod.outlook.com \
    --to=hedrick@rutgers.edu \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).