All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 00/10] NFSD support for asynchronous COPY
@ 2018-02-20 16:42 Olga Kornievskaia
  2018-02-20 16:42 ` [PATCH v7 01/10] NFSD CB_OFFLOAD xdr Olga Kornievskaia
                   ` (9 more replies)
  0 siblings, 10 replies; 34+ messages in thread
From: Olga Kornievskaia @ 2018-02-20 16:42 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

To do asynchronous copies, NFSD creates a new kthread to handle the request.
Upon receiving the COPY, it generates a unique copy stateid (stored in a
global list for keeping track of state for OFFLOAD_STATUS to be queried by),
starts the thread, and replies back to the client. nfsd4_copy arguments that
are allocated on the stack are copies for the kthread.

For the async copy handler, copy is done in the loop for the requested
number of bytes. If an error is encountered and partial copy has happened,
a successful partial copy is returned in the CB_OFFLOAD. vfs_copy_file_range
is called with 4MB chunks for both async and sync, allowing for 4MB
granularity of OFFLOAD_STATUS queiry. Once copy is done, the results are
queued for the callback workqueue and sent via CB_OFFLOAD.

When the server received an OFFLOAD_CANCEL, it will find the kthread running
the copy and will send a SIGPENDING and kthread_stop() and it will interrupt
the ongoing do_splice() and once vfs returns we are choosing not to send
the CB_OFFLOAD back to the client.

When the server receives an OFFLOAD_STATUS, it will find the kthread running
the copy and will locate within the copy state the current number of bytes
copied so far.

v7 addresses Bruce's comments:
1. hardcoding returning 0bytes for the error case
2. shutting down copy before shutting down callback
3. adding the copy to the list of copies after the copy_task is initialized
4. introducing the async code but not enabling it until after the following
patches add creating and returning the unique stateid for the async copy.
5. changing copy's refcount from atomic_t to refcount_t
6. making sure that list sc_cp_list is accessed under the pstid->sc_lock

Olga Kornievskaia (10):
  NFSD CB_OFFLOAD xdr
  NFSD OFFLOAD_STATUS xdr
  NFSD OFFLOAD_CANCEL xdr
  NFSD xdr callback stateid in async COPY reply
  NFSD introduce asynch copy feature
  NFSD return nfs4_stid in nfs4_preprocess_stateid_op
  NFSD create new stateid for async copy
  NFSD handle OFFLOAD_CANCEL op
  NFSD support OFFLOAD_STATUS
  NFSD stop queued async copies on client shutdown

 fs/nfsd/netns.h        |   8 ++
 fs/nfsd/nfs4callback.c |  98 +++++++++++++++
 fs/nfsd/nfs4proc.c     | 317 ++++++++++++++++++++++++++++++++++++++++++++-----
 fs/nfsd/nfs4state.c    |  80 ++++++++++++-
 fs/nfsd/nfs4xdr.c      |  50 ++++++--
 fs/nfsd/nfsctl.c       |   1 +
 fs/nfsd/state.h        |  21 +++-
 fs/nfsd/xdr4.h         |  28 +++++
 fs/nfsd/xdr4cb.h       |  10 ++
 9 files changed, 576 insertions(+), 37 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-04-12 20:06 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 16:42 [PATCH v7 00/10] NFSD support for asynchronous COPY Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 01/10] NFSD CB_OFFLOAD xdr Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 02/10] NFSD OFFLOAD_STATUS xdr Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 03/10] NFSD OFFLOAD_CANCEL xdr Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 04/10] NFSD xdr callback stateid in async COPY reply Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 05/10] NFSD introduce asynch copy feature Olga Kornievskaia
2018-03-06 21:27   ` J. Bruce Fields
2018-03-07 20:48     ` Olga Kornievskaia
2018-03-07 20:38   ` J. Bruce Fields
2018-03-07 20:50     ` Olga Kornievskaia
2018-03-07 21:05   ` J. Bruce Fields
2018-03-07 22:06     ` Olga Kornievskaia
2018-03-08 15:07       ` J. Bruce Fields
2018-03-22 15:08     ` Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 06/10] NFSD return nfs4_stid in nfs4_preprocess_stateid_op Olga Kornievskaia
2018-03-07 21:43   ` J. Bruce Fields
2018-03-07 21:54     ` Olga Kornievskaia
2018-03-08 15:14       ` J. Bruce Fields
2018-02-20 16:42 ` [PATCH v7 07/10] NFSD create new stateid for async copy Olga Kornievskaia
2018-03-08 16:31   ` J. Bruce Fields
2018-03-22 15:12     ` Olga Kornievskaia
2018-03-22 15:17       ` J. Bruce Fields
2018-03-22 16:40         ` Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 08/10] NFSD handle OFFLOAD_CANCEL op Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 09/10] NFSD support OFFLOAD_STATUS Olga Kornievskaia
2018-02-20 16:42 ` [PATCH v7 10/10] NFSD stop queued async copies on client shutdown Olga Kornievskaia
2018-03-08 17:05   ` J. Bruce Fields
2018-04-10 20:09     ` Olga Kornievskaia
2018-04-10 20:21       ` J. Bruce Fields
2018-04-10 21:07         ` Olga Kornievskaia
2018-04-10 21:13           ` J. Bruce Fields
2018-04-11 17:33             ` J. Bruce Fields
2018-04-12 20:05               ` Olga Kornievskaia
2018-04-12 20:06                 ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.