linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Olga Kornievskaia <kolga@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v9 0/9] NFSD support for async COPY
Date: Thu, 12 Jul 2018 14:56:12 -0400	[thread overview]
Message-ID: <20180712185611.GB10033@parsley.fieldses.org> (raw)
In-Reply-To: <20180709192638.44799-1-kolga@netapp.com>

On Mon, Jul 09, 2018 at 03:26:29PM -0400, Olga Kornievskaia wrote:
> From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
> 
> 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.
> 
> v9:
> -- added module parameter (async_copy_offload_enable) to turns on async
> copy processing on the server

I think we got confused in the previous discussion of this.

The reason I wanted the module parameter was that server-to-server copy
would allow a rogue client to direct the server to copy from any server
it wishes, and I thought this was potentially risky, and want people to
opt into it rather than having it the default.

That doesn't apply to asynchronous copy on its own.

So this module parameter could wait for the next patchset.

--b.

> -- fixes some kbuild errors from the previous submission
> 
> 
> Olga Kornievskaia (9):
>   NFSD CB_OFFLOAD xdr
>   NFSD OFFLOAD_STATUS xdr
>   NFSD OFFLOAD_CANCEL xdr
>   NFSD xdr callback stateid in async COPY reply
>   NFSD introduce async copy feature
>   NFSD create new stateid for async copy
>   NFSD handle OFFLOAD_CANCEL op
>   NFSD support OFFLOAD_STATUS
>   NFSD stop ongoing async copies on client shutdown
> 
>  fs/nfsd/netns.h        |   8 ++
>  fs/nfsd/nfs4callback.c |  98 +++++++++++++++++
>  fs/nfsd/nfs4proc.c     | 291 ++++++++++++++++++++++++++++++++++++++++++++++---
>  fs/nfsd/nfs4state.c    |  38 ++++++-
>  fs/nfsd/nfs4xdr.c      |  50 +++++++--
>  fs/nfsd/nfsctl.c       |   1 +
>  fs/nfsd/nfssvc.c       |   6 +
>  fs/nfsd/state.h        |  10 ++
>  fs/nfsd/xdr4.h         |  29 +++++
>  fs/nfsd/xdr4cb.h       |  10 ++
>  10 files changed, 517 insertions(+), 24 deletions(-)
> 
> -- 
> 1.8.3.1
> 

  parent reply	other threads:[~2018-07-12 19:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 19:26 [PATCH v9 0/9] NFSD support for async COPY Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 1/9] NFSD CB_OFFLOAD xdr Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 2/9] NFSD OFFLOAD_STATUS xdr Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 3/9] NFSD OFFLOAD_CANCEL xdr Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 4/9] NFSD xdr callback stateid in async COPY reply Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 5/9] NFSD introduce async copy feature Olga Kornievskaia
2018-07-12 21:18   ` J. Bruce Fields
2018-07-09 19:26 ` [PATCH v9 6/9] NFSD create new stateid for async copy Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 7/9] NFSD handle OFFLOAD_CANCEL op Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 8/9] NFSD support OFFLOAD_STATUS Olga Kornievskaia
2018-07-09 19:26 ` [PATCH v9 9/9] NFSD stop ongoing async copies on client shutdown Olga Kornievskaia
2018-07-12 18:56 ` J. Bruce Fields [this message]
2018-07-12 19:11   ` [PATCH v9 0/9] NFSD support for async COPY Olga Kornievskaia
2018-07-12 19:16     ` J. Bruce Fields
2018-07-15 22:52       ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180712185611.GB10033@parsley.fieldses.org \
    --to=bfields@redhat.com \
    --cc=kolga@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).