Re: [PATCH v3 0/8] NFSD: CB_RECALL_ANY fixes and a meaningful keep count
Jeff Layton <[email protected]>
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 2026-08-13 at 14:40 -0400, Chuck Lever wrote: > NFSD currently sends every CB_RECALL_ANY with craa_objects_to_keep > set to zero, as RFC 8881 Section 20.6.3 does not mandate any > particular way for a client to choose which delegations to return, > if any. > > NFSD intends CB_RECALL_ANY only as a signal to return currently > unused delegations. To date, only the Linux NFS client has been > deeply tested against it. That implementation ignores the > craa_objects_to_keep value and returns only one unused delegation > of the named types. Therefore the fixed zero craa_objects_to_keep > value never produced visible misbehavior during our testing. > > However, a zero value can result in non-Linux clients giving back > more delegations than is necessary to relieve temporary memory > pressure on the server, which needlessly punctures the clients' > delegation working set. > > Change NFSD so that each CB_RECALL_ANY asks a client to give up a > sensible number of delegations instead of all of them at once. To > handle the accounting correctly, it is necessary for this series to > split the current state shrinker mechanism. The patch descriptions > have those details. > > --- > Changes in v3: > - Count delegations per namespace so each shrinker reports its own. > - Give courtesy clients and delegations separate state shrinkers. > - Record the shrinker's scan requests and discount the count by them. > - Scale each client's CB_RECALL_ANY by its share of the scan request. > - Reword the keep-count rationale in the commit message and comment. > - Link to v2: https://patch.msgid.link/[email protected] > > Changes in v2: > - Drop the gate that skipped clients holding a single delegation. > - Cover letter rewritten to give performance rationale. > - Link to v1: https://patch.msgid.link/[email protected] > > --- > Chuck Lever (8): > NFSD: Do not send CB_RECALL_ANY to NFSv4.0 clients > NFSD: Count the delegations held by each client > NFSD: Name directory delegations in the CB_RECALL_ANY type mask > NFSD: Send a meaningful CB_RECALL_ANY keep count > NFSD: Count delegations per network namespace > NFSD: Give delegations their own state shrinker > NFSD: Pace the state shrinker's scan requests > NFSD: Apportion CB_RECALL_ANY recalls among clients > > fs/nfsd/netns.h | 17 +++- > fs/nfsd/nfs4state.c | 235 +++++++++++++++++++++++++++++++++++++++++++++------- > fs/nfsd/state.h | 2 + > 3 files changed, 223 insertions(+), 31 deletions(-) > --- > base-commit: 1d479c6b53f684b27da84ec352b7efb97f7f115f > change-id: 20260810-recall-any-keep-count-f50c2ae1b792 > > Best regards, > -- > Chuck Lever <[email protected]> You can add this to 5-8: Reviewed-by: Jeff Layton <[email protected]>