All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/10] NFSD support for asynchronous COPY
@ 2017-10-13 20:54 Olga Kornievskaia
  2017-10-13 20:54 ` [PATCH v5 01/10] NFSD CB_OFFLOAD xdr Olga Kornievskaia
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Olga Kornievskaia @ 2017-10-13 20:54 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.

In the async copy handler, it calls into VFS copy_file_range() (for synch
we keep the 4MB chunk and requested size for the async copy). If error is
encountered it's saved but also we save the amount of data copied so far.
Once 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 query the i_size_read() of the associated filehandle of
the destination file and return the result.

v5:
1. reimplementing asynchronous copy to use kthreads instead of the workqueue
2. store asynchronous copies in the list of the nfs4_client structure
3. when copying nfsd4_copy datastructure for the async copy refcount the
nfs4_client structure as well as struct file src/dst structure
4. add refcount to the nfsd4_copy structure to coordinate with offload_status
and offload_cancel
5. offload_cancel/copy_shutdown sets the SIGPENDING in the copy's thread to
interrupt do_splice and calls kthread_stop to wait for the copy to stop
6. offload_cancel adds MODIFIES_SOMETHING to flags
7. offload_status reports the size of the destination file form i_size_read()
instead of before 4MB loop updated chunk size.
8. for async copy call vfs_copy_file_range() with the whole copy size. still
keep the loop to do more the MAX_RW_COUNT that do_splice can do.

Olga Kornievskaia (10):
  NFSD CB_OFFLOAD xdr
  NFSD OFFLOAD_STATUS xdr
  NFSD OFFLOAD_CANCEL xdr
  NFSD xdr callback stateid in async COPY reply
  NFSD first draft of async copy
  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 |  97 +++++++++++++++
 fs/nfsd/nfs4proc.c     | 321 ++++++++++++++++++++++++++++++++++++++++++++-----
 fs/nfsd/nfs4state.c    |  77 +++++++++++-
 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] 21+ messages in thread

end of thread, other threads:[~2017-10-24 13:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13 20:54 [PATCH v5 00/10] NFSD support for asynchronous COPY Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 01/10] NFSD CB_OFFLOAD xdr Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 02/10] NFSD OFFLOAD_STATUS xdr Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 03/10] NFSD OFFLOAD_CANCEL xdr Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 04/10] NFSD xdr callback stateid in async COPY reply Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 05/10] NFSD first draft of async copy Olga Kornievskaia
2017-10-14 13:45   ` Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 06/10] NFSD return nfs4_stid in nfs4_preprocess_stateid_op Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 07/10] NFSD create new stateid for async copy Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 08/10] NFSD handle OFFLOAD_CANCEL op Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 09/10] NFSD support OFFLOAD_STATUS Olga Kornievskaia
2017-10-13 20:54 ` [PATCH v5 10/10] NFSD stop queued async copies on client shutdown Olga Kornievskaia
2017-10-13 21:26 ` [PATCH v5 00/10] NFSD support for asynchronous COPY J. Bruce Fields
2017-10-14  0:09   ` Olga Kornievskaia
2017-10-16 13:13     ` Anna Schumaker
2017-10-16 13:37       ` Mauricio Tavares
2017-10-16 16:49       ` J. Bruce Fields
2017-10-16 19:25         ` Olga Kornievskaia
2017-10-23 21:48           ` Olga Kornievskaia
2017-10-23 22:39             ` Olga Kornievskaia
2017-10-24 13:35               ` 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.