Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Jan Kara <jack@suse.cz>
Cc: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Limit size of bios submitted from writeback
Date: Thu, 23 Apr 2026 07:13:59 +0930	[thread overview]
Message-ID: <13e12285-329a-46d2-8182-b6e8568275e6@suse.com> (raw)
In-Reply-To: <kfksarpckjgqr52rk2p2uhabgb666rfrp2hewnra7mbzbcujqr@5pwsegezuzuf>



在 2026/4/22 22:19, Jan Kara 写道:
[...]
>> Iterating through all chunk maps may take some time for huge filesystems.
> 
> Yeah, I was wondering a bit. But since this is done only on mount, I
> figured it doesn't matter much.
> 
>> Meanwhile the device list is way smaller than the chunk maps, what about
>> iterating through all devices instead?
> 
> I was thinking about that as well. But as you can see below, we also need
> to know how the devices are put together in a raid and AFAIU that
> information isn't there at the device level... If there's some better data
> structure to iterate to get information about raid configurations of all
> pieces of btrfs filesystem, I can certainly use that.

My idea would be just ignore the detailed RAID configuration completely.

One point is, btrfs can have more than one data profiles (e.g. during 
balance, or canceled balance, or degraded writes), and even there is 
only a single data profile, we can still have different optimized sizes, 
e.g. RAID10 on very unbalanced disks.

Furthermore for real multi-device btrfs setup, it's very likely the data 
profile is at least striped (RAID0/RAID10), thus the huge bio will be 
split into 64K stripes by btrfs before submission already.

It's really affecting single-device profiles like SINGLE/DUP and 
mirror-only profiles (RAID1*), where we directly submit such huge bio to 
each device.

With that said, it will be much easier to ignore the complex RAID 
profile iteration, and just grab the min/max optimal io size of each 
device, multiple it by the number of disks and call it a day.

Thanks,
Qu

  reply	other threads:[~2026-04-22 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22  9:42 [PATCH] btrfs: Limit size of bios submitted from writeback Jan Kara
2026-04-22 10:29 ` Qu Wenruo
2026-04-22 12:49   ` Jan Kara
2026-04-22 21:43     ` Qu Wenruo [this message]
2026-04-23  7:57       ` Jan Kara

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=13e12285-329a-46d2-8182-b6e8568275e6@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.com \
    --cc=jack@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