[PATCH v5 0/8] NFSD: CB_RECALL_ANY fixes and a meaningful keep count
Chuck Lever <[email protected]>
| Newsgroups | gmane.linux.nfs |
|---|---|
| Message-ID | <[email protected]> |
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 v5:
- Exclude clients the sweep skips from the apportionment's divisor.
- Skip clients whose CB_RECALL_ANY callback is still running.
- Discount the delegation shrinker's count by its pending requests.
- Link to v4: https://patch.msgid.link/20260815-recall-any-keep-count-v4-0-bfb5b83d6cb1-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Changes in v4:
- Avoid a divide by zero when max_delegations is zero.
- Collect Jeff's Reviewed-by on 5-8, given on the v3 posting.
- Link to v3: https://patch.msgid.link/20260813-recall-any-keep-count-v3-0-a96d243c0b13-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
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/20260812-recall-any-keep-count-v2-0-a82f4ca23812-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
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/20260811-recall-any-keep-count-v1-0-de9ca00493b7-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
---
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 | 285 +++++++++++++++++++++++++++++++++++++++++++++-------
fs/nfsd/state.h | 2 +
3 files changed, 267 insertions(+), 37 deletions(-)
---
base-commit: de7051270554f99559f9b6bcf3c4fb695c7c223d
change-id: 20260810-recall-any-keep-count-f50c2ae1b792
Best regards,
--
Chuck Lever <[email protected]>