From: Josef Bacik <josef@toxicpanda.com>
To: "Holger Hoffstätte" <holger@applied-asynchrony.com>,
rene@exactcode.de, linux-btrfs@vger.kernel.org
Subject: Re: [BUG] 500-2000% performance regression w/ 5.10
Date: Wed, 23 Dec 2020 15:34:31 -0500 [thread overview]
Message-ID: <908523cc-e5df-490c-4735-302e11f841c1@toxicpanda.com> (raw)
In-Reply-To: <276b374f-57fe-f354-9571-9f76d743785d@applied-asynchrony.com>
On 12/23/20 3:31 PM, Holger Hoffstätte wrote:
> On 2020-12-23 20:41, Josef Bacik wrote:
>> Could you give this a try? I'm not able to reproduce the problem, but
>> I'm
>
> Since I wanted to rule out NVME/block layer/scheduler etc. I tried and
> could reproduce it immediately, see below. Didn't notice it earlier since
> most of btrfs is read-mostly.. :(
>
>> testing inside of a VM. I'm in the middle of Christmas stuff, but
>> I'll get
>> ahold of a giant machine at work tomorrow and see if I can reproduce
>> there.
>> Meanwhile can you give this a shot? I have a sneaking suspicion why
>> it happens
>> on your baremetal and not in VM's, and this will be a partial enough
>> of a revert
>> of the patch you bisected to validate what I'm thinking. THanks,
>
> The patch doesn't apply to 5.10.x since btrfs_start_delalloc_roots()
> does not
> have the trailing true/false argument yet. I removed it, which seemed to
> have
> worked. :}
>
> Results using -dsingle/-msingle/space tree, all on tmpfs:
>
> Unpatched:
>
> kernel tree, ~1.1G:
> $time (cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter)
> ( cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter; ) 0.37s
> user 3.26s system 6% cpu 52.144 total
>
> -> slow as hell since it's thousands of small files. Writeback runs at
> ~5-10 MB/s.
>
> large file:
> $fallocate -l 2G /tmp/largefile
> $time (cp -a /tmp/largefile /tmp/butter && sync -f /tmp/butter)
> ( cp -a /tmp/largefile /tmp/butter && sync -f /tmp/butter; ) 0.00s user
> 0.91s system 75% cpu 1.215 total
>
> -> OK-ish since it's just one big file.
>
> With your patch & the 'true' arg to btrfs_start_delalloc_roots() removed:
>
> kernel tree:
> $time (cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter)
> ( cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter; ) 0.28s
> user 2.44s system 60% cpu 4.475 total
>
> rewrite:
> $time (cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter)
> ( cp -a /tmp/linux-5.10.3 /tmp/butter && sync -f /tmp/butter; ) 0.28s
> user 2.87s system 93% cpu 3.357 total
>
> Clearly better.
>
> Hope this helps :)
>
Oops I built on top of our devel branch and not 5.10, my bad. This does
help and validates my theory. I'll work out a proper fix soon for
everybody to test, probably tomorrow so I don't risk being murdered by
my wife. Thanks,
Josef
next prev parent reply other threads:[~2020-12-23 20:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 19:45 [BUG] 500-2000% performance regression w/ 5.10 René Rebe
2020-12-22 8:28 ` Qu Wenruo
2020-12-22 9:12 ` Rene Rebe
2020-12-23 3:14 ` Josef Bacik
2020-12-23 19:41 ` Josef Bacik
2020-12-23 20:31 ` Holger Hoffstätte
2020-12-23 20:34 ` Josef Bacik [this message]
2020-12-24 18:09 ` Josef Bacik
2020-12-24 21:11 ` René Rebe
2020-12-26 12:24 ` Nikolay Borisov
2020-12-26 15:30 ` Rene Rebe
2020-12-26 12:23 ` Nikolay Borisov
2021-01-04 1:15 ` Chris Murphy
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=908523cc-e5df-490c-4735-302e11f841c1@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=holger@applied-asynchrony.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=rene@exactcode.de \
/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