All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Christoph Hellwig <hch@infradead.org>, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] btrfs: do data read repair in synchronous mode
Date: Fri, 25 Mar 2022 09:43:09 -0700	[thread overview]
Message-ID: <Yj3xHarLow3FRMRR@infradead.org> (raw)
In-Reply-To: <dd03a779-f996-4e45-e06e-f75acea97ff7@gmx.com>

On Fri, Mar 25, 2022 at 06:53:31PM +0800, Qu Wenruo wrote:
> > I'd suggest to at least submit all I/O in parallel.  Just put
> > a structure with an atomic_t and completion on the stack.  Start with
> > a recount of one, inc for each submit, and then dec after all
> > submissions and for each completion and only wake on the final dec.
> > That will make sure there is only one wait instead of one per copy.
> > 
> > Extra benefits for also doing this for all sectors, but that might be
> > a little more work.
> 
> Exactly the same plan B in my head.
> 
> A small problem is related to how to record all these corrupted sectors.
> 
> Using a on-stack bitmap would be the best, and it's feasible for x86_64
> at least.
> (256 bvecs = 256x4K pages = 256 sectors = 256bits).
> But not that sure for larger page size.
> As the same 256 bvecs can go 256x64K pages = 256 * 16 sectors, way too
> large for on-stack bitmap.
> 
> 
> If we go list, we need extra memory allocation, which can be feasible
> but less simple.

Just chunk it up so that only up to a reasonable bitmap size worth of
I/O is done at a time.

  parent reply	other threads:[~2022-03-25 16:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  9:42 [PATCH RFC 0/2] btrfs: make read repair work in synchronous mode Qu Wenruo
2022-03-25  9:42 ` [PATCH RFC 1/2] btrfs: introduce a pure data checksum checking helper Qu Wenruo
2022-03-25 10:14   ` Johannes Thumshirn
2022-03-25  9:42 ` [PATCH RFC 2/2] btrfs: do data read repair in synchronous mode Qu Wenruo
2022-03-25 10:27   ` Christoph Hellwig
2022-03-25 10:53     ` Qu Wenruo
2022-03-25 14:58       ` Sweet Tea Dorminy
2022-03-26  0:13         ` Qu Wenruo
2022-03-26  1:10           ` Qu Wenruo
2022-03-29  6:17             ` Christoph Hellwig
2022-03-29  6:16           ` Christoph Hellwig
2022-03-25 16:43       ` Christoph Hellwig [this message]
2022-03-26  0:12         ` Qu Wenruo
2022-04-19 19:19 ` [PATCH RFC 0/2] btrfs: make read repair work " David Sterba
2022-04-19 23:22   ` 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=Yj3xHarLow3FRMRR@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.