Skip to content

RFC NFS (just) async support for COPY

Olga Kornievskaia linux-nfs 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest12 patches 0 repliesNew
  2. v1 RFC19 patches 28 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12NFS CB_OFFLOAD xdrfs/nfs/callback.h fs/nfs/callback_proc.c fs/nfs/callback_xdr.c+99 -10 replies
2/12NFS OFFLOAD_STATUS xdrfs/nfs/nfs42xdr.c fs/nfs/nfs4proc.c fs/nfs/nfs4xdr.c +3 more+103 -00 replies
3/12NFS OFFLOAD_STATUS opfs/nfs/nfs42.h fs/nfs/nfs42proc.c+44 -10 replies
4/12NFS OFFLOAD_CANCEL xdrfs/nfs/nfs42xdr.c fs/nfs/nfs4proc.c fs/nfs/nfs4xdr.c +2 more+70 -00 replies
5/12NFS COPY xdr handle async replyfs/nfs/nfs42xdr.c include/linux/nfs_xdr.h+13 -100 replies
6/12NFS add support for asynchronous COPYfs/nfs/callback_proc.c fs/nfs/client.c fs/nfs/nfs42proc.c +3 more+88 -50 replies
7/12NFS handle COPY reply CB_OFFLOAD call racefs/nfs/callback_proc.c fs/nfs/nfs42proc.c fs/nfs/nfs4client.c +1 more+51 -60 replies
8/12NFS send OFFLOAD_CANCEL when COPY killedfs/nfs/nfs42proc.c+91 -20 replies
9/12NFS make COPY synchronous xdr configurablefs/nfs/nfs42proc.c fs/nfs/nfs42xdr.c include/linux/nfs_xdr.h+4 -10 replies
10/12NFS handle COPY ERR_OFFLOAD_NO_REQSfs/nfs/nfs42proc.c+7 -00 replies
11/12NFS if we got partial copy ignore errorsfs/nfs/nfs42proc.c+2 -10 replies
12/12NFS recover from destination server reboot for copiesfs/nfs/nfs42proc.c fs/nfs/nfs4_fs.h fs/nfs/nfs4file.c +2 more+44 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC v2 00/12] NFS (just) async support for COPY

In version 2:
This series separates support for async COPY (no inter support).

Simple timings to demonstrate the usefulness of the async copy implementation.
This is async "intra" SSC vs normal copy vs upstream sync SSC time ./nfscopy /mnt/1024MB.txt 0 /mnt/1024 0 10240000000

real    1m47.036s
user    0m0.001s
sys     0m0.002s

time cp /mnt/1024MB.txt /mnt/1024

real    3m10.121s
user    0m0.060s
sys     0m9.365s

(existing "intra" client against "intra" server) time ./nfscopy /mnt/1024MB.txt 0 /mnt/1024 0 10240000000

real    2m45.975s
user    0m0.022s
sys     0m0.452s
Quoted 1 line

From version 1 cover letter:

Client sends an asynchronous COPY to the server (always). If server errs with ERR_OFFLOAD_NOREQS the copy will be re-sent as a synchronous COPY. If application cancels an in-flight COPY, OFFLOAD_CANCEL is sent to the source server.

If server replies to the COPY with the copy stateid, client will go wait on the CB_OFFLOAD. To fend off the race between CB_OFFLOAD and COPY reply, we check the list of pending callbacks before going to wait. Client adds the copy to the global list of copy stateids for the callback to look thru and signal the waiting copy.

If application cancels async COPY after reply is received, wait will be interrupted and client will send OFFLOAD_CANCEL to the server (sending it as an async RPC in the context of the nfsiod_workqueue).

When the client receives reply from the CB_OFFLOAD with some bytes and committed how is UNSTABLE, then COMMIT is sent to the server. The results arep propagated to the VFS and application. Assuming that application will deal with a partial result and continue from the new offset if needed.

Handling reboot of the destination server when client is waiting on the CB_OFFLOAD happens when SEQUENCE discovers that destination server rebooted. The open state initially is marked to be NFS_CLNT_DST_SSC_COPY_STATE during the COPY. Then during the recovery if state is marked as such, then look thru the list of copies for the server and see if any are associated with this recovering open, if so mark the copy rebooted and wake up the waiting copy. Upon wake up the waiting copy, will restart the copy from scratch.

If CB_OFFLOAD returned an error and non negative value of partial copy and error is not ENOSPC, then ignore the error and send the commit and return partial result to the client to start the next copy.

Olga Kornievskaia (12):
NFS CB_OFFLOAD xdr
NFS OFFLOAD_STATUS xdr
NFS OFFLOAD_STATUS op
NFS OFFLOAD_CANCEL xdr
NFS COPY xdr handle async reply
NFS add support for asynchronous COPY
NFS handle COPY reply CB_OFFLOAD call race NFS send OFFLOAD_CANCEL when COPY killed
NFS make COPY synchronous xdr configurable NFS handle COPY ERR_OFFLOAD_NO_REQS
NFS if we got partial copy ignore errors
NFS recover from destination server reboot for copies

 fs/nfs/callback.h         |  13 +++
 fs/nfs/callback_proc.c    |  52 +++++++++++
 fs/nfs/callback_xdr.c     |  80 ++++++++++++++++-
 fs/nfs/client.c           |   1 +
 fs/nfs/nfs42.h            |   3 +-
 fs/nfs/nfs42proc.c        | 222 ++++++++++++++++++++++++++++++++++++++++++++--
 fs/nfs/nfs42xdr.c         | 177 +++++++++++++++++++++++++++++++++---
 fs/nfs/nfs4_fs.h          |   4 +
 fs/nfs/nfs4client.c       |  15 ++++
 fs/nfs/nfs4file.c         |   9 +-
 fs/nfs/nfs4proc.c         |   2 +
 fs/nfs/nfs4state.c        |  15 ++++
 fs/nfs/nfs4xdr.c          |   2 +
 include/linux/nfs4.h      |   2 +
 include/linux/nfs_fs.h    |  11 +++
 include/linux/nfs_fs_sb.h |   4 +
 include/linux/nfs_xdr.h   |  14 +++
 17 files changed, 605 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.3.1