From: Damien Le Moal <dlemoal@kernel.org>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
linux-btrfs@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>,
Hans Holmberg <Hans.Holmberg@wdc.com>,
Naohiro Aota <naohiro.aota@wdc.com>,
Josef Bacik <josef@toxicpanda.com>,
Filipe Manana <fdmanana@suse.com>,
David Sterba <dsterba@suse.com>, Boris Burkov <boris@bur.io>,
Qu Wenruo <wqu@suse.com>,
Wilfred Mallawa <wilfred.opensource@gmail.com>
Subject: Re: [PATCH 5/5] btrfs: zoned: break concurrent chunk allocation race
Date: Fri, 27 Nov 2026 06:30:31 +0900 [thread overview]
Message-ID: <27ca67bf-0d07-48f3-ad8a-c2d799e2ac8e@kernel.org> (raw)
In-Reply-To: <20261126132820.570379-6-johannes.thumshirn@wdc.com>
On 11/26/26 22:28, Johannes Thumshirn wrote:
> btrfs_chunk_alloc() coalesces concurrent allocations, so a fresh
> block-group request can end up without a chunk of its own when several
> new files race.
>
> Retry the chunk allocation a few times before giving up on a fresh
> block-group.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Modulo the already commented fact that "fresh" is not a super nice name, looks
good to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
But I strongly suggest to be more precise with the naming and replace "fresh"
with "free" or "empty" and always have bg or block_group as the qualifying name.
E.g. ffe_ctl->want_empty_bg
That would make the code a lot easier to follow and avoid confusions with other
things that can be fresh, like beer :)
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2026-11-26 21:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 13:28 [PATCH 0/5] btrfs: rework data placement on zoned devices Johannes Thumshirn
2026-11-26 13:28 ` [PATCH 1/5] btrfs: zoned: search for hinted block-group in prepare_allocation_zoned Johannes Thumshirn
2026-11-26 21:09 ` Damien Le Moal
2026-11-26 13:28 ` [PATCH 2/5] btrfs: zoned: save last allocation as placement hint Johannes Thumshirn
2026-11-26 21:11 ` Damien Le Moal
2026-11-26 13:28 ` [PATCH 3/5] btrfs: zoned: allocate a new block-group per file Johannes Thumshirn
2026-11-26 21:20 ` Damien Le Moal
2026-11-26 13:28 ` [PATCH 4/5] btrfs: zoned: try to fill hinted block-groups Johannes Thumshirn
2026-11-26 21:25 ` Damien Le Moal
2026-11-26 13:28 ` [PATCH 5/5] btrfs: zoned: break concurrent chunk allocation race Johannes Thumshirn
2026-11-26 21:30 ` Damien Le Moal [this message]
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=27ca67bf-0d07-48f3-ad8a-c2d799e2ac8e@kernel.org \
--to=dlemoal@kernel.org \
--cc=Hans.Holmberg@wdc.com \
--cc=boris@bur.io \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=hch@lst.de \
--cc=johannes.thumshirn@wdc.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
--cc=wilfred.opensource@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox