public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 5/5] btrfs: cache max and min order inside btrfs_fs_info
Date: Sat, 6 Sep 2025 18:17:48 +0930	[thread overview]
Message-ID: <589e4ad2-b853-4f87-a813-e7e800e9d9fb@suse.com> (raw)
In-Reply-To: <20250905173638.GQ5333@twin.jikos.cz>



在 2025/9/6 03:06, David Sterba 写道:
> On Tue, Sep 02, 2025 at 06:32:16PM +0930, Qu Wenruo wrote:
>> Inside btrfs_fs_info we cache several bits shift like sectorsize_bits.
>>
>> Apply this to max and min folio orders so that every time mapping order
>> needs to be applied we can skip the calculation.
> 
> I've checked where and how many times is btrfs_set_inode_mapping_order()
> called and it's basically once per newly accessed inode. Caching the
> values in fs_info may not make much sense compared to the other cached
> members for the shifts.

For now you're right. But the following code will need to access that 
min_order in the very soon:

- Compression
   For compressed folios.

- RAID56
- Scrub
   To match the min order so that the btrfs_bio_for_each_block*() will
   work correctly.

So it may not be that obvious for now, but will make more sense soon.

Thanks,
Qu

  reply	other threads:[~2025-09-06  8:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  9:02 [PATCH v2 0/5] btrfs: bs > ps support preparation Qu Wenruo
2025-09-02  9:02 ` [PATCH v2 1/5] btrfs: support all block sizes which is no larger than page size Qu Wenruo
2025-09-02  9:02 ` [PATCH v2 2/5] btrfs: concentrate highmem handling for data verification Qu Wenruo
2025-09-02  9:02 ` [PATCH v2 3/5] btrfs: introduce btrfs_bio_for_each_block() helper Qu Wenruo
2025-09-02  9:02 ` [PATCH v2 4/5] btrfs: introduce btrfs_bio_for_each_block_all() helper Qu Wenruo
2025-09-05 17:33   ` David Sterba
2025-09-05 22:08     ` Qu Wenruo
2025-09-08 17:44       ` David Sterba
2025-09-02  9:02 ` [PATCH v2 5/5] btrfs: cache max and min order inside btrfs_fs_info Qu Wenruo
2025-09-05 17:36   ` David Sterba
2025-09-06  8:47     ` Qu Wenruo [this message]
2025-09-05 17:47 ` [PATCH v2 0/5] btrfs: bs > ps support preparation 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=589e4ad2-b853-4f87-a813-e7e800e9d9fb@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.cz \
    --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