From: Wang Yugui <wangyugui@e16-tech.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: newer /bin/cp have worse btrfs fiemap performance.
Date: Sun, 06 Nov 2022 08:16:24 +0800 [thread overview]
Message-ID: <20221106081623.7A83.409509F4@e16-tech.com> (raw)
In-Reply-To: <20221106073028.71F9.409509F4@e16-tech.com>
Hi,
a fix.
> Hi,
>
> newer /bin/cp have worse btrfs fiemap performance.
>
> btrfs version: misc-next 750de989d367(the lastest of 2022/11/05)
> /bin/cp versions(run them on the same server)
> 8.22 copy from centos/7.9
this
> 8.30 rocklinux/9.0
should be
8.30 rocklinux/8
Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2022/11/06
> 9.1 local build, https://kojipkgs.fedoraproject.org/packages/coreutils/9.1/8.eln121/
>
> test case:
> /bin/cp /mnt/test/file1 /dev/null
> /mnt/test/file1 is created by https://lore.kernel.org/linux-btrfs/YuwUw2JLKtIa9X+S@localhost.localdomain/T/#T
> and /mnt/test/file1 is 256M.
>
> file is not cached: 'echo 3 >/proc/sys/vm/drop_caches'
> file is cached: run '/bin/cp /mnt/test/file1 /dev/null' again.
>
> performance result(/bin/cp /mnt/test/file1 /dev/null):
> /bin/cp 9.1
> file is not cached: 94.85(1:34.85)
> file is cached: 1982.43(33:02.43)
> /bin/cp 8.30
> file is not cached: 1.48(0:01.48)
> file is cached:14.07(0:14.07)
> /bin/cp 8.22
> file is not cached: 0.53(0:00.53)
> file is cached: 0.10(0:00.10)
>
> as a compare, we test it on xfs too.
> 1) /bin/cp 8.22/8.30/9.1 have almost same performance.
> 2) the case(the file is cached) is faster than the case(the file is not
> cached).
>
> strace show that the logical of /bin/cp 8.30 and 9.1 are different.
> /bin/cp 8.30
> lseek(3, 198737920, SEEK_SET) = 198737920
> write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> read(3, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> write(4, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> lseek(3, 198746112, SEEK_SET) = 198746112
> write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> read(3, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> write(4, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
>
> /bin/cp 9.1
> lseek(3, 880640, SEEK_DATA) = 884736
> lseek(3, 884736, SEEK_HOLE) = 888832
> lseek(3, 884736, SEEK_SET) = 884736
> write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> read(3, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> write(4, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> lseek(3, 888832, SEEK_DATA) = 892928
> lseek(3, 892928, SEEK_HOLE) = 897024
> lseek(3, 892928, SEEK_SET) = 892928
> write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> read(3, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
> write(4, "a\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
>
> Do we need some job in btrfs to support /bin/cp 9.1 well,
> or /bin/cp 9.1 is just wrong?
>
> Best Regards
> Wang Yugui (wangyugui@e16-tech.com)
> 2022/11/06
>
next prev parent reply other threads:[~2022-11-06 0:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-05 23:30 newer /bin/cp have worse btrfs fiemap performance Wang Yugui
2022-11-06 0:16 ` Wang Yugui [this message]
2022-11-07 8:36 ` Filipe Manana
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=20221106081623.7A83.409509F4@e16-tech.com \
--to=wangyugui@e16-tech.com \
--cc=linux-btrfs@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