All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.com>
Subject: Re: [PATCH v5 03/13] btrfs: introduce a new helper to submit read bio for scrub
Date: Tue, 28 Mar 2023 08:16:38 +0800	[thread overview]
Message-ID: <cd8a91ee-2e30-9829-b50d-599fab3fb490@suse.com> (raw)
In-Reply-To: <ZCIoQLysbLrQW0pX@infradead.org>



On 2023/3/28 07:35, Christoph Hellwig wrote:
> On Tue, Mar 28, 2023 at 07:30:53AM +0800, Qu Wenruo wrote:
>> The new helper, btrfs_submit_scrub_read(), would be mostly a subset of
>> btrfs_submit_bio(), with the following limitations:
>>
>> - Only supports read
>> - @mirror_num must be > 0
>> - No read-time repair nor checksum verification
>> - The @bbio must not cross stripe boundary
>>
>> This would provide the basis for unified read repair for scrub, as we no
>> longer needs to handle RAID56 recovery all by scrub, and RAID56 data
>> stripes scrub can share the same code of read and repair.
>>
>> The repair part would be the same as non-RAID56, as we only need to try
>> the next mirror.
> 
> Stupid question: what do we actually still need this and the write helper
> for now that I think the generic helpers should work just fine without
> bbio->inode?

For read part, as long as we skip all the csum verification and csum 
search, it can go the generic helper.
Although this may needs some coordinate during merge.

But in the future, mostly for the ZNS RST patches, we need special 
handling for the garbage range.

Johannes is already testing his RST branches upon this series, and he is 
hitting the ASSERT() on the mapped length due to RST changes.
In that case, we need to skip certain ranges, and that's specific to 
scrub usage.

Thus for read part, I'd still prefer a scrub specific helper, for the 
incoming RST expansion.


For the write helper, it's very different.

The btrfs_submit_bio() would duplicate the writes to all mirrors, which 
is exactly what I want to avoid for scrub usage.
Thus the scrub specific write helper would always map the write to a 
single stripe, even for RAID56 writes.

So the write helper must stay.

Thanks,
Qu

  reply	other threads:[~2023-03-28  0:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 23:30 [PATCH v5 00/13] btrfs: scrub: use a more reader friendly code to implement scrub_simple_mirror() Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 01/13] btrfs: scrub: use dedicated super block verification function to scrub one super block Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 02/13] btrfs: introduce a new allocator for scrub specific btrfs_bio Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 03/13] btrfs: introduce a new helper to submit read bio for scrub Qu Wenruo
2023-03-27 23:35   ` Christoph Hellwig
2023-03-28  0:16     ` Qu Wenruo [this message]
2023-03-28  0:25       ` Christoph Hellwig
2023-03-28  0:48         ` Qu Wenruo
2023-03-28  0:53           ` Christoph Hellwig
2023-03-28  1:01             ` Qu Wenruo
2023-03-28  1:04               ` Christoph Hellwig
2023-03-28  1:10                 ` Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 04/13] btrfs: introduce a new helper to submit write " Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 05/13] btrfs: scrub: introduce the structure for new BTRFS_STRIPE_LEN based interface Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 06/13] btrfs: scrub: introduce a helper to find and fill the sector info for a scrub_stripe Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 07/13] btrfs: scrub: introduce a helper to verify one metadata Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 08/13] btrfs: scrub: introduce a helper to verify one scrub_stripe Qu Wenruo
2023-03-27 23:30 ` [PATCH v5 09/13] btrfs: scrub: introduce the main read repair worker for scrub_stripe Qu Wenruo
2023-03-27 23:31 ` [PATCH v5 10/13] btrfs: scrub: introduce a writeback helper " Qu Wenruo
2023-03-27 23:31 ` [PATCH v5 11/13] btrfs: scrub: introduce error reporting functionality " Qu Wenruo
2023-03-27 23:31 ` [PATCH v5 12/13] btrfs: scrub: introduce the helper to queue a stripe for scrub Qu Wenruo
2023-03-27 23:31 ` [PATCH v5 13/13] btrfs: scrub: switch scrub_simple_mirror() to scrub_stripe infrastructure 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=cd8a91ee-2e30-9829-b50d-599fab3fb490@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.com \
    --cc=hch@infradead.org \
    --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 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.