From: Johannes Thumshirn <jth@kernel.org>
To: linux-btrfs@vger.kernel.org
Cc: Damien Le Moal <dlemoal@kernel.org>,
Naohiro Aota <naohiro.aota@wdc.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH v2 0/3] btrfs: zoned: reduce lock contention in zoned extent allocator
Date: Tue, 24 Jun 2025 11:37:07 +0200 [thread overview]
Message-ID: <20250624093710.18685-1-jth@kernel.org> (raw)
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
While investigating performance issues on zoned btrfs, I've analyzed
lockstat output while running fio workloads.
Three locks that have always been on top are the space_info's ->lock, as
well as fs_info's ->treelog_bg_lock and ->relocation_bg_lock.
The first one is not as trivial to get rid and most likely legit in most
cases (see patch #3). The other two are only protecting a single value in
fs_info and can be replaced by REAC_ONCE() and WRITE_ONCE().
The series has been run through fstests on tcmu-runner emulated SMR drives
as well as Damien's fio benchmarks on real ZNS hardware and no regressions
have been observed.
Changes in v2:
- Rewording of the commit message (Damien)
- No more local variables caching the values (Damien)
Johannes Thumshirn (3):
btrfs: zoned: get rid of relocation_bg_lock
btrfs: zoned: get rid of treelog_bg_lock
btrfs: zoned: don't hold space_info lock on zoned allocation
fs/btrfs/disk-io.c | 2 -
fs/btrfs/extent-tree.c | 86 +++++++++++-------------------------------
fs/btrfs/fs.h | 7 +---
fs/btrfs/zoned.c | 12 +++---
fs/btrfs/zoned.h | 6 +--
5 files changed, 31 insertions(+), 82 deletions(-)
--
2.49.0
next reply other threads:[~2025-06-24 9:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 9:37 Johannes Thumshirn [this message]
2025-06-24 9:37 ` [PATCH v2 1/3] btrfs: zoned: get rid of relocation_bg_lock Johannes Thumshirn
2025-06-24 12:32 ` Naohiro Aota
2025-06-25 10:28 ` Johannes Thumshirn
2025-06-24 9:37 ` [PATCH v2 2/3] btrfs: zoned: get rid of treelog_bg_lock Johannes Thumshirn
2025-06-24 9:37 ` [PATCH v2 3/3] btrfs: zoned: don't hold space_info lock on zoned allocation Johannes Thumshirn
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=20250624093710.18685-1-jth@kernel.org \
--to=jth@kernel.org \
--cc=dlemoal@kernel.org \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).