From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/4] btrfs: Update per-profile available space when device size/used space get updated
Date: Thu, 2 Jan 2020 11:17:31 -0500 [thread overview]
Message-ID: <c4f6ddfb-c52c-d376-4cef-26aebec4e288@toxicpanda.com> (raw)
In-Reply-To: <20200102112746.145045-3-wqu@suse.com>
On 1/2/20 6:27 AM, Qu Wenruo wrote:
> There are 4 locations where device size or used space get updated:
> - Chunk allocation
> - Chunk removal
> - Device grow
> - Device shrink
>
> Now also update per-profile available space at those timings.
>
> For __btrfs_alloc_chunk() we can't acquire device_list_mutex as in
> btrfs_finish_chunk_alloc() we could hold device_list_mutex and cause
> dead lock.
>
These are protecting two different things though, holding the chunk_mutex
doesn't keep things from being removed from the device list.
Looking at patch 1 can't we just do the device list traversal under RCU and then
not have to worry about the locking at all? Thanks,
Josef
next prev parent reply other threads:[~2020-01-02 16:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-02 11:27 [PATCH v2 0/4] Introduce per-profile available space array to avoid over-confident can_overcommit() Qu Wenruo
2020-01-02 11:27 ` [PATCH v2 1/4] btrfs: Introduce per-profile available space facility Qu Wenruo
2020-01-02 16:13 ` Josef Bacik
2020-01-04 6:40 ` kbuild test robot
2020-01-02 11:27 ` [PATCH v2 2/4] btrfs: Update per-profile available space when device size/used space get updated Qu Wenruo
2020-01-02 16:17 ` Josef Bacik [this message]
2020-01-03 0:51 ` Qu Wenruo
2020-01-03 9:52 ` Qu Wenruo
2020-01-03 16:35 ` Josef Bacik
2020-01-02 11:27 ` [PATCH v2 3/4] btrfs: space-info: Use per-profile available space in can_overcommit() Qu Wenruo
2020-01-02 16:18 ` Josef Bacik
2020-01-02 11:27 ` [PATCH v2 4/4] btrfs: statfs: Use virtual chunk allocation to calculation available data space Qu Wenruo
2020-01-02 16:20 ` Josef Bacik
2020-01-03 0:38 ` Qu Wenruo
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=c4f6ddfb-c52c-d376-4cef-26aebec4e288@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--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