From: Josef Bacik <josef@toxicpanda.com>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH resend] btrfs: mount: call btrfs_check_rw_degradable only if there is a missing device
Date: Tue, 19 Oct 2021 10:06:32 -0400 [thread overview]
Message-ID: <YW7Q6ABqX+8jHJ+b@localhost.localdomain> (raw)
In-Reply-To: <f417a0730df69830b07db681eb0992a3ceb99d81.1630639255.git.anand.jain@oracle.com>
On Tue, Oct 19, 2021 at 06:43:38PM +0800, Anand Jain wrote:
> In open_ctree() in btrfs_check_rw_degradable() [1], we check each block
> group individually if at least the minimum number of devices is available
> for that profile. If all the devices are available, then we don't have to
> check degradable.
>
> [1]
> open_ctree()
> ::
> 3559 if (!sb_rdonly(sb) && !btrfs_check_rw_degradable(fs_info, NULL)) {
>
> Also before calling btrfs_check_rw_degradable() in open_ctee() at the
> line number shown below [2] we call btrfs_read_chunk_tree() and down to
> add_missing_dev() to record number of missing devices.
>
> [2]
> open_ctree()
> ::
> 3454 ret = btrfs_read_chunk_tree(fs_info);
>
> btrfs_read_chunk_tree()
> read_one_chunk() / read_one_dev()
> add_missing_dev()
>
> So, check if there is any missing device before btrfs_check_rw_degradable()
> in open_ctree().
>
> With this, in an example, the mount command could save ~16ms.[3] in the
> most common case, that is no device is missing.
>
> [3]
> 1) * 16934.96 us | btrfs_check_rw_degradable [btrfs]();
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Thanks,
Josef
next prev parent reply other threads:[~2021-10-19 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 10:43 [PATCH resend] btrfs: mount: call btrfs_check_rw_degradable only if there is a missing device Anand Jain
2021-10-19 14:06 ` Josef Bacik [this message]
2021-10-25 17:18 ` 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=YW7Q6ABqX+8jHJ+b@localhost.localdomain \
--to=josef@toxicpanda.com \
--cc=anand.jain@oracle.com \
--cc=linux-btrfs@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