mbox series

[RFC,0/4] btrfs: scrub: make sctx->stripes[] a ring buffer

Message ID cover.1689744163.git.wqu@suse.com (mailing list archive)
Headers show
Series btrfs: scrub: make sctx->stripes[] a ring buffer | expand

Message

Qu Wenruo July 19, 2023, 5:30 a.m. UTC
!!! DO NOT MERGE !!!

This is the attempt to increase the queue depth of the scrub behavior.

Although it has a slight increase on the queue depth, it's not enough to
cause any obvious performance increase.

It's still short of 2GiB/s.

The patchset's idea is to avoid any unnecessary wait, by making
sctx->stripes[] a ring buffer, callers just grab the current slot and
queue the stripe.

The wait only happens when the current slot is still under scrub.

Unfrotauntely the benchmark doesn't help much, meaning the bottleneck is
not at the deidcated wait when the sctx->stripes[] are full.

Thus this patch is mostly sent asking for better ideas.

I'll try manually merging the read requests to see if we can get
anything better.

Qu Wenruo (4):
  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: use btrfs workqueue to synchronize the write back for
    dev-replace
  btrfs: scrub: make sctx->stripes[] array work as a ring buffer

 fs/btrfs/fs.h    |   2 +-
 fs/btrfs/scrub.c | 493 ++++++++++++++++++++++++-----------------------
 2 files changed, 249 insertions(+), 246 deletions(-)

Comments

Martin Steigerwald July 19, 2023, 6:34 a.m. UTC | #1
Hi Qu.

Qu Wenruo - 19.07.23, 07:30:22 CEST:
> This is the attempt to increase the queue depth of the scrub behavior.
> 
> Although it has a slight increase on the queue depth, it's not enough
> to cause any obvious performance increase.
> 
> It's still short of 2GiB/s.
[…]
> Thus this patch is mostly sent asking for better ideas.

Hmm, another approach would be to revert the patches that introduced the 
performance regression. It would release the pressure to find a fix soon. 
Then you'd have all the time to have another go at improving scrubbing. 
At least the issue at hand seems to be tricky.

What you think?

Thanks,
Martin Steigerwald July 19, 2023, 6:44 a.m. UTC | #2
Martin Steigerwald - 19.07.23, 08:34:51 CEST:
> Qu Wenruo - 19.07.23, 07:30:22 CEST:
> > This is the attempt to increase the queue depth of the scrub
> > behavior.
[…]
> > Thus this patch is mostly sent asking for better ideas.
> 
> Hmm, another approach would be to revert the patches that introduced
> the performance regression. It would release the pressure to find a
> fix soon. Then you'd have all the time to have another go at
> improving scrubbing. At least the issue at hand seems to be tricky.
> 
> What you think?

Sorry, missed that you posted another patch later. So just ignore this 
idea.

Thanks,