public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@kernel.org>
To: Anton Gavriliuk <antosha20xx@gmail.com>, linux-nfs@vger.kernel.org
Subject: Re: nfs client and io_uring zero copy receive
Date: Tue, 22 Jul 2025 14:43:34 -0400	[thread overview]
Message-ID: <76c35f2fc9386f3e77defe87375c4ad110618aaf.camel@kernel.org> (raw)
In-Reply-To: <CAAiJnjqvKAE_dUiCTr8D5UShNK5fxJuUHpP=nDFadF-OYhYbfw@mail.gmail.com>

On Tue, 2025-07-22 at 21:10 +0300, Anton Gavriliuk wrote:
> Hi
> 
> I am trying to exceed 20 GB/s doing sequential read from a single
> file
> on the nfs client.
> 
> perf top shows excessive memcpy usage:
> 
> Samples: 237K of event 'cycles:P', 4000 Hz, Event count (approx.):
> 120872739112 lost: 0/0 drop: 0/0
> Overhead  Shared Object                      Symbol
>   20,54%  [kernel]                           [k] memcpy
>    6,52%  [nfs]                              [k] nfs_generic_pg_test
>    5,12%  [nfs]                              [k] nfs_page_group_lock
>    4,92%  [kernel]                           [k] _copy_to_iter
>    4,79%  [kernel]                           [k] gro_list_prepare
>    2,77%  [nfs]                              [k] nfs_clear_request
>    2,10%  [nfs]                              [k]
> __nfs_pageio_add_request
>    2,07%  [kernel]                           [k] check_heap_object
>    2,00%  [kernel]                           [k] __slab_free
> 
> Can nfs client be adopted to use zero copy ?, for example by using
> io_uring zero copy rx.
> 

The client has no idea in which order the server will return replies to
the RPC calls it sends. So no, it can't queue up those reply buffers in
advance.

The only way you can avoid memory copies here is to use RDMA to allow
the server to write its replies directly into the correct client read
buffers.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trondmy@kernel.org, trond.myklebust@hammerspace.com

  reply	other threads:[~2025-07-22 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-22 18:10 nfs client and io_uring zero copy receive Anton Gavriliuk
2025-07-22 18:43 ` Trond Myklebust [this message]
2025-07-22 19:01   ` Anton Gavriliuk
2025-07-22 19:40     ` Trond Myklebust

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=76c35f2fc9386f3e77defe87375c4ad110618aaf.camel@kernel.org \
    --to=trondmy@kernel.org \
    --cc=antosha20xx@gmail.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