linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/5] btrfs: scrub: fix the scrub performance regression caused by unnecessary extent/csum tree searchs
Date: Thu, 20 Jul 2023 18:48:10 +0800	[thread overview]
Message-ID: <cover.1689849582.git.wqu@suse.com> (raw)

Although patch "btrfs: scrub: fix grouping of read IO" fixed one of the
major performance regression of scrub, it still only get the performance
back to 2GiB/s, it's still only 66% of the old 3GiB/s.

During my local debug, I found that the data csum fulfilling by itself
can be a big bottleneck.
If I completely skip the data csum fulfilling, it can already improve
the performance to around 2.6GiB/s (but of course it makes no sense
without data csums).

This reminds me a big factor, since we're doing scrub in stripe unit,
it would cause a lot of more extent/csum tree search.

In fact, the old code is doing csum search for every 512KiB, while we're
doing the same search for every 64KiB, causing 8x increase in csum tree
search.

Thus this patch would reduce the extent/csum tree search by re-using the
paths.

This two points along would already improve the performance to a much
more acceptable 2.5GiB/s. (83% of the old performance).

And those two patches are small enough for backports.

The remaining 3 patches are mostly cleanups.

Qu Wenruo (5):
  btrfs: scrub: avoid unnecessary extent tree search preparing stripes
  btrfs: scrub: avoid unnecessary csum tree search preparing stripes
  btrfs: scrub: move write back of repaired sectors into 
    scrub_stripe_read_repair_worker()
  btrfs: scrub: don't go ordered workqueue for dev-replace
  btrfs: scrub: extract the stripe group submission into a helper

 fs/btrfs/file-item.c |  33 +++++----
 fs/btrfs/file-item.h |   6 +-
 fs/btrfs/raid56.c    |   4 +-
 fs/btrfs/scrub.c     | 156 +++++++++++++++++++++++++++++--------------
 4 files changed, 133 insertions(+), 66 deletions(-)

-- 
2.41.0


             reply	other threads:[~2023-07-20 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 10:48 Qu Wenruo [this message]
2023-07-20 10:48 ` [PATCH 1/5] btrfs: scrub: avoid unnecessary extent tree search preparing stripes Qu Wenruo
2023-07-20 13:27   ` Johannes Thumshirn
2023-07-20 10:48 ` [PATCH 2/5] btrfs: scrub: avoid unnecessary csum " Qu Wenruo
2023-07-20 10:48 ` [PATCH 3/5] btrfs: scrub: move write back of repaired sectors into scrub_stripe_read_repair_worker() Qu Wenruo
2023-07-20 10:48 ` [PATCH 4/5] btrfs: scrub: don't go ordered workqueue for dev-replace Qu Wenruo
2023-07-20 10:48 ` [PATCH 5/5] btrfs: scrub: extract the stripe group submission into a helper Qu Wenruo

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=cover.1689849582.git.wqu@suse.com \
    --to=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).