mbox series

[v4,0/8] Wait for DELEGRETURN before returning NFS4ERR_DELAY

Message ID 166267495153.1842.14474564029477470642.stgit@manet.1015granger.net (mailing list archive)
Headers show
Series Wait for DELEGRETURN before returning NFS4ERR_DELAY | expand

Message

Chuck Lever Sept. 8, 2022, 10:13 p.m. UTC
This patch series adds logic to the Linux NFS server to make it wait
a few moments for clients to return a delegation before replying
with NFS4ERR_DELAY. There are two main benefits:

- It improves responsiveness when a delegated file is accessed from
  another client, and
- It removes an unnecessary latency if a client has neglected to
  return a delegation before attempting a RENAME or SETATTR

NFS4ERR_DELAY during NFSv4 OPEN is still not handled. However, I'm
comfortable merging the infrastructure in this series and support
for using it in SETATTR, RENAME, and REMOVE now, and then handling
OPEN at a later time.

This series applies against v6.0-rc4.

Changes since v3:
- Also handle JUKEBOX when an NFSv3 operation triggers a CB_RECALL

Changes since v2:
- Wake immediately after server receives DELEGRETURN
- More tracepoint improvements

Changes since RFC:
- Eliminate spurious console messages on the server
- Wait for DELEGRETURN for RENAME operations
- Add CB done tracepoints
- Rework the retry loop

---

Chuck Lever (8):
      NFSD: Replace dprintk() call site in fh_verify()
      NFSD: Trace NFSv4 COMPOUND tags
      NFSD: Add tracepoints to report NFSv4 callback completions
      NFSD: Add a mechanism to wait for a DELEGRETURN
      NFSD: Refactor nfsd_setattr()
      NFSD: Make nfsd4_setattr() wait before returning NFS4ERR_DELAY
      NFSD: Make nfsd4_rename() wait before returning NFS4ERR_DELAY
      NFSD: Make nfsd4_remove() wait before returning NFS4ERR_DELAY


 fs/nfsd/nfs4layouts.c |   2 +-
 fs/nfsd/nfs4proc.c    |   6 +-
 fs/nfsd/nfs4state.c   |  34 +++++++++++
 fs/nfsd/nfsd.h        |   7 +++
 fs/nfsd/nfsfh.c       |   8 +--
 fs/nfsd/trace.h       | 131 ++++++++++++++++++++++++++++++++++++++----
 fs/nfsd/vfs.c         | 100 ++++++++++++++++++++------------
 7 files changed, 233 insertions(+), 55 deletions(-)

--
Chuck Lever

Comments

Jeff Layton Sept. 12, 2022, 4:21 p.m. UTC | #1
On Thu, 2022-09-08 at 18:13 -0400, Chuck Lever wrote:
> This patch series adds logic to the Linux NFS server to make it wait
> a few moments for clients to return a delegation before replying
> with NFS4ERR_DELAY. There are two main benefits:
> 
> - It improves responsiveness when a delegated file is accessed from
>   another client, and
> - It removes an unnecessary latency if a client has neglected to
>   return a delegation before attempting a RENAME or SETATTR
> 
> NFS4ERR_DELAY during NFSv4 OPEN is still not handled. However, I'm
> comfortable merging the infrastructure in this series and support
> for using it in SETATTR, RENAME, and REMOVE now, and then handling
> OPEN at a later time.
> 
> This series applies against v6.0-rc4.
> 
> Changes since v3:
> - Also handle JUKEBOX when an NFSv3 operation triggers a CB_RECALL
> 
> Changes since v2:
> - Wake immediately after server receives DELEGRETURN
> - More tracepoint improvements
> 
> Changes since RFC:
> - Eliminate spurious console messages on the server
> - Wait for DELEGRETURN for RENAME operations
> - Add CB done tracepoints
> - Rework the retry loop
> 
> ---
> 
> Chuck Lever (8):
>       NFSD: Replace dprintk() call site in fh_verify()
>       NFSD: Trace NFSv4 COMPOUND tags
>       NFSD: Add tracepoints to report NFSv4 callback completions
>       NFSD: Add a mechanism to wait for a DELEGRETURN
>       NFSD: Refactor nfsd_setattr()
>       NFSD: Make nfsd4_setattr() wait before returning NFS4ERR_DELAY
>       NFSD: Make nfsd4_rename() wait before returning NFS4ERR_DELAY
>       NFSD: Make nfsd4_remove() wait before returning NFS4ERR_DELAY
> 
> 
>  fs/nfsd/nfs4layouts.c |   2 +-
>  fs/nfsd/nfs4proc.c    |   6 +-
>  fs/nfsd/nfs4state.c   |  34 +++++++++++
>  fs/nfsd/nfsd.h        |   7 +++
>  fs/nfsd/nfsfh.c       |   8 +--
>  fs/nfsd/trace.h       | 131 ++++++++++++++++++++++++++++++++++++++----
>  fs/nfsd/vfs.c         | 100 ++++++++++++++++++++------------
>  7 files changed, 233 insertions(+), 55 deletions(-)
> 
> --
> Chuck Lever
> 

Nice work, Chuck. These all look reasonable to me.

Reviewed-by: Jeff Layton <jlayton@kernel.org>