From: David Sterba <dsterba@suse.cz>
To: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Cc: naohiro.aota@wdc.com, boris@bur.io, clm@fb.com, dsterba@suse.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] btrfs: zoned: remove redundant space_info lock and variable in do_allocation_zoned
Date: Wed, 4 Feb 2026 15:40:06 +0100 [thread overview]
Message-ID: <20260204144006.GT26902@twin.jikos.cz> (raw)
In-Reply-To: <20260114144450.48776-1-jiashengjiangcool@gmail.com>
On Wed, Jan 14, 2026 at 02:44:50PM +0000, Jiasheng Jiang wrote:
> In do_allocation_zoned(), the code acquires space_info->lock before
> block_group->lock. However, the critical section does not access or
> modify any members of the space_info structure. Thus, the lock is
> redundant as it provides no necessary synchronization here.
>
> This change simplifies the locking logic and aligns the function with
> other zoned paths, such as __btrfs_add_free_space_zoned(), which only
> rely on block_group->lock. Since the 'space_info' local variable is
> no longer used after removing the lock calls, it is also removed.
>
> Removing this unnecessary lock reduces contention on the global
> space_info lock, improving concurrency in the zoned allocation path.
>
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Added to for-next, thanks.
prev parent reply other threads:[~2026-02-04 14:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 15:40 [PATCH] btrfs: zoned: remove redundant space_info lock and variable in do_allocation_zoned Jiasheng Jiang
2026-01-12 18:56 ` Boris Burkov
2026-01-12 20:22 ` [PATCH v2] " Jiasheng Jiang
2026-01-13 18:29 ` Boris Burkov
2026-01-14 11:24 ` Johannes Thumshirn
2026-01-14 13:09 ` Naohiro Aota
2026-01-14 14:44 ` [PATCH v3] " Jiasheng Jiang
2026-02-04 14:40 ` David Sterba [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=20260204144006.GT26902@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=boris@bur.io \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=jiashengjiangcool@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naohiro.aota@wdc.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