From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <jth@kernel.org>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Hans Holmberg <Hans.Holmberg@wdc.com>,
Naohiro Aota <Naohiro.Aota@wdc.com>,
hch@lst.de, Damien LeMoal <dlemoal@kernel.org>,
Boris Burkov <boris@bur.io>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH RFC PATCH 1/3] btrfs: zoned: traverse device list in should reclaim under rcu_read_lock
Date: Thu, 4 Apr 2024 21:35:56 +0200 [thread overview]
Message-ID: <20240404193556.GJ14596@twin.jikos.cz> (raw)
In-Reply-To: <20240328-hans-v1-1-4cd558959407@kernel.org>
Subject: btrfs: zoned: traverse device list in should reclaim under rcu_read_lock
Please use the function name in the subject instead of the description,
so like
btrfs: zoned: traverse device list under RCU lock in btrfs_zoned_should_reclaim()
On Thu, Mar 28, 2024 at 02:56:31PM +0100, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>
> As btrfs_zoned_should_reclaim() traverses the device list with the
> device_list_mutex held. But we're never changing the device list. All we
> do is gathering the used and total bytes.
>
> So change the list traversal from the holding the device_list_mutex to
> rcu_read_lock(). This also opens up the possibilities to call
> btrfs_zoned_should_reclaim() with the chunk_mutex held.
You can add this patch independently, the device_list_mutex does not
seem to be needed for strong consistency of the values you read.
There are several other places where devices are under RCU only, like
btrfs_commit_device_sizes (though this is also in the transaction
context), various ioctls and btrfs_calc_avail_data_space().
next prev parent reply other threads:[~2024-04-04 19:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 13:56 [PATCH RFC 0/3] btrfs: zoned: reclaim block-groups more aggressively Johannes Thumshirn
2024-03-28 13:56 ` [PATCH RFC PATCH 1/3] btrfs: zoned: traverse device list in should reclaim under rcu_read_lock Johannes Thumshirn
2024-04-04 19:35 ` David Sterba [this message]
2024-03-28 13:56 ` [PATCH RFC PATCH 2/3] btrfs: zoned: reserve relocation zone on mount Johannes Thumshirn
2024-03-28 23:05 ` Damien Le Moal
2024-04-02 6:03 ` Naohiro Aota
2024-04-02 17:04 ` Boris Burkov
2024-04-05 5:03 ` Naohiro Aota
2024-04-05 1:14 ` Naohiro Aota
2024-03-28 13:56 ` [PATCH RFC PATCH 3/3] btrfs: zoned: kick cleaner kthread if low on space Johannes Thumshirn
2024-03-28 23:06 ` Damien Le Moal
2024-04-02 17:09 ` Boris Burkov
2024-04-04 19:45 ` 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=20240404193556.GJ14596@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=Hans.Holmberg@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=boris@bur.io \
--cc=clm@fb.com \
--cc=dlemoal@kernel.org \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=johannes.thumshirn@wdc.com \
--cc=josef@toxicpanda.com \
--cc=jth@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@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