All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <aglo@umich.edu>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: Olga Kornievskaia <kolga@netapp.com>,
	linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v5 00/10] NFSD support for asynchronous COPY
Date: Fri, 13 Oct 2017 20:09:40 -0400	[thread overview]
Message-ID: <CAN-5tyETeVgOWKeFSBxQBJi6wwXTcgQqaxxLn0BFXCTCv09h0g@mail.gmail.com> (raw)
In-Reply-To: <20171013212626.GB28854@parsley.fieldses.org>

On Fri, Oct 13, 2017 at 5:26 PM, J. Bruce Fields <bfields@redhat.com> wrote:
> On Fri, Oct 13, 2017 at 04:54:02PM -0400, Olga Kornievskaia wrote:
>> 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.
>
> That assumes we're copying into a previously empty file?

Sigh. Alright, then it's back to my original solution where I broke
everything into 4MB calls and kept track of bytes copies so far.

>
> --b.
>
>>
>> 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
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-10-14  0:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=CAN-5tyETeVgOWKeFSBxQBJi6wwXTcgQqaxxLn0BFXCTCv09h0g@mail.gmail.com \
    --to=aglo@umich.edu \
    --cc=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 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.