All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 02/12] btrfs: introduce a new helper to submit bio for scrub
Date: Sat, 25 Mar 2023 16:21:41 +0800	[thread overview]
Message-ID: <9581646d-380f-2b55-07ac-2abd37822577@gmx.com> (raw)
In-Reply-To: <ZB6sQGoP9dbsgvX7@infradead.org>



On 2023/3/25 16:09, Christoph Hellwig wrote:
> On Fri, Mar 24, 2023 at 05:58:57PM +0800, Qu Wenruo wrote:
>> I have updated the branch, with a dedicated btrfs_bio::fs_info,
>> btrfs_scrub_bio_alloc() and always populate that new fs_info.
>>
>> Mind to have a pre-check?
>>
>> https://github.com/adam900710/linux/commit/0f6a419f035787546eec6f51b0430a05a345d4c5
> 
> I'd prefer to just pass a fs_info to btrfs_bio_init and btrfs_bio_alloc
> instead of duplicating the allocator.  With my "simplify extent_buffer
> reading and writing" series and another tiny change we'll only need the
> inode for data inodes.  But given that we've not made too much
> progress on getting that series merged I guess we'll have to add
> the duplicate allocator for now and just revert it later.

No big deal, I can go with the extra fs_info parameter for 
btrfs_bio_init() and btrfs_bio_alloc().

The main reason I go with the duplicated allocate is to remove the need 
for nr_vecs, but that's pretty minor, thus not a critical one.

> 
> I'd drop the ASSERT in btrfs_submit_bio - all allocators initialize
> the field, no need for the extra check.

OK, sounds reasonable.

> 
>> Although the next two patches are also slightly updated to take the
>> advantage of that always populated fs_info:
> 
> I think you wanted to add links here, but they are missing.
> 
>> Since the modification, I'm a little more dependent on that always populated
>> fs_info now, thus not sure if going back to a union and conditionally
>> grabbing that fs_info is a good idea.
> 
> I don't think the union is a good idea at all.  Maybe in the future
> we can move the inode into a union, but right now the csum for data
> read is the upper bound on the btrfs_bio, so I'm not sure we'll
> ever get to a point where that would help.

Yeah, let's avoid union and let fs_info always populated.

Thanks,
Qu

> 
>> Although I'm more interested why there is a super big gap between work and
>> bio (32 bytes), while the compiler still refuses to put the pointer into
>> that hole...
> 
> I don't think there is one.  pahole just reports structs strangely
> sometimes.

  reply	other threads:[~2023-03-25  8:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20  2:12 [PATCH v3 00/12] btrfs: scrub: use a more reader friendly code to implement scrub_simple_mirror() Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 01/12] btrfs: scrub: use dedicated super block verification function to scrub one super block Qu Wenruo
2023-03-21  5:22   ` Anand Jain
2023-03-21  7:25     ` Qu Wenruo
2023-03-21 22:12       ` David Sterba
2023-03-20  2:12 ` [PATCH v3 02/12] btrfs: introduce a new helper to submit bio for scrub Qu Wenruo
2023-03-21 12:02   ` Christoph Hellwig
2023-03-24  9:58     ` Qu Wenruo
2023-03-25  8:09       ` Christoph Hellwig
2023-03-25  8:21         ` Qu Wenruo [this message]
2023-03-25  8:31           ` Christoph Hellwig
2023-03-25  8:48             ` Qu Wenruo
2023-03-27  3:36               ` Christoph Hellwig
2023-03-20  2:12 ` [PATCH v3 03/12] btrfs: introduce a new helper to submit write " Qu Wenruo
2023-03-21  0:14   ` David Sterba
2023-03-21  0:54     ` Qu Wenruo
2023-03-21  1:27       ` David Sterba
2023-03-23  8:48     ` Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 04/12] btrfs: scrub: introduce the structure for new BTRFS_STRIPE_LEN based interface Qu Wenruo
2023-03-21  0:22   ` David Sterba
2023-03-20  2:12 ` [PATCH v3 05/12] btrfs: scrub: introduce a helper to find and fill the sector info for a scrub_stripe Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 06/12] btrfs: scrub: introduce a helper to verify one metadata Qu Wenruo
2023-03-21  0:31   ` David Sterba
2023-03-20  2:12 ` [PATCH v3 07/12] btrfs: scrub: introduce a helper to verify one scrub_stripe Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 08/12] btrfs: scrub: introduce the main read repair worker for scrub_stripe Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 09/12] btrfs: scrub: introduce a writeback helper " Qu Wenruo
2023-03-21  0:43   ` David Sterba
2023-03-20  2:12 ` [PATCH v3 10/12] btrfs: scrub: introduce error reporting functionality " Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 11/12] btrfs: scrub: introduce the helper to queue a stripe for scrub Qu Wenruo
2023-03-20  2:12 ` [PATCH v3 12/12] btrfs: scrub: switch scrub_simple_mirror() to scrub_stripe infrastructure Qu Wenruo
2023-03-21  1:12   ` David Sterba
2023-03-21  0:09 ` [PATCH v3 00/12] btrfs: scrub: use a more reader friendly code to implement scrub_simple_mirror() David Sterba
2023-03-23  6:28   ` Qu Wenruo
2023-03-23 17:51     ` David Sterba
2023-03-24  0:42       ` Qu Wenruo
2023-03-27 23:28         ` David Sterba

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=9581646d-380f-2b55-07ac-2abd37822577@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --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.