linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Wang Yugui <wangyugui@e16-tech.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: question about the performance of 'btrfs send'
Date: Mon, 17 Oct 2022 15:02:52 +0200	[thread overview]
Message-ID: <20221017130252.GN13389@twin.jikos.cz> (raw)
In-Reply-To: <20221015203501.E1ED.409509F4@e16-tech.com>

On Sat, Oct 15, 2022 at 08:35:01PM +0800, Wang Yugui wrote:
> Hi,
> 
> a question about the performance of 'btrfs send'.
> 
> The output speed of 'btrfs send' is about 700MiB/s in the 3 cases.
> 1) kernel 5.15.73 + 'btrfs send --proto 1'
> 2) kernel: 6.0.1(with btrfs-devel misc-6.1) +  'btrfs send --proto 1'
> 3) kernel: 6.0.1(with btrfs-devel misc-6.1) +  'btrfs send --proto 2'
> btrfs-progs: 6.0
> 
> the outut of 'perf report':
> Overhead  Command  Shared Object      Symbol
> *1  40.63%  btrfs    [kernel.kallsyms]  [k] __crc32c_le
> *2   9.97%  btrfs    [kernel.kallsyms]  [k] memcpy_erms
> *3   9.25%  btrfs    [kernel.kallsyms]  [k] send_extent_data
> *4   5.40%  btrfs    [kernel.kallsyms]  [k] asm_exc_nmi
> *5   2.73%  btrfs    [kernel.kallsyms]  [k] __alloc_pages
>    1.14%  btrfs    [kernel.kallsyms]  [k] __rmqueue_pcplist
>    0.92%  btrfs    [kernel.kallsyms]  [k] bad_range
>    0.88%  btrfs    [kernel.kallsyms]  [k] get_page_from_freelist
> 
> What I expected:
> the above *1) __crc32c_le take >60%, and the outut speed > 1GiB/s.
> The *1) __crc32c_le is necessary operation, and the speed
> seems OK.  2GB/s * 40% = 800MiB/s, it is close to 700MiB/s.
> 
> Question:
> The above *3) is difficult to understand. Any advice?

The perf report does not include IO, right? It's only CPU time spent.
That it's accounted only for send_extent_data would also mean there's
some function inlining involved so it does not point exactly where the
time is spent. I'd say it's the main loop around send_write that emits
the commands and works with memory data.

What could be suboptimal is the call get_cur_path in send_write that
rebuilds the path each time even though it's for the same file.

      reply	other threads:[~2022-10-17 13:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-15 12:35 question about the performance of 'btrfs send' Wang Yugui
2022-10-17 13:02 ` David Sterba [this message]

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=20221017130252.GN13389@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangyugui@e16-tech.com \
    /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).