linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: Calvin Walton <calvin.walton@kepstin.ca>
Cc: Josef Bacik <josef@redhat.com>,
	linux-btrfs@vger.kernel.org, Chris Mason <chris.mason@oracle.com>
Subject: Re: Boot speed/mount time regression with 3.4.0-rc2
Date: Mon, 9 Apr 2012 16:54:30 -0400	[thread overview]
Message-ID: <20120409205429.GB6958@localhost.localdomain> (raw)
In-Reply-To: <1333991404.2817.6.camel@ayu>

On Mon, Apr 09, 2012 at 01:10:04PM -0400, Calvin Walton wrote:
> On Mon, 2012-04-09 at 11:53 -0400, Calvin Walton wrote:
> > Hi,
> > 
> > I have a system that's using a dracut-generated initramfs to mount a
> > btrfs root. After upgrading to kernel 3.4.0-rc2 to test it out, I've
> > noticed that the process of mounting the root filesystem takes much
> > longer with 3.4.0-rc2 than it did with 3.3.1 - nearly 30 seconds slower!
> > 
> > Does anyone have any ideas? I'm going to try bisecting the issue to see
> > if I can narrow down the cause. I've included excerpts from dmesg of the
> > bad and good kernels here, and attached the complete dmesg from the bad
> > kernel, in case it has anything interesting that I've trimmed out here.
> 
> And the bisect results are in:
> 285ff5af6ce358e73f53b55c9efadd4335f4c2ff is the first bad commit
> commit 285ff5af6ce358e73f53b55c9efadd4335f4c2ff
> Author: Josef Bacik <josef@redhat.com>
> Date:   Fri Jan 13 15:27:45 2012 -0500
> 
>     Btrfs: remove the ideal caching code
>    
>     This is a relic from before we had the disk space cache and it was to make
>     bootup times when you had btrfs as root not be so damned slow.  Now that we have
>     the disk space cache this isn't a problem anymore and really having this code
>     casues uneeded fragmentation and complexity, so just remove it.  Thanks,
>     
>     Signed-off-by: Josef Bacik <josef@redhat.com>
> 
> The commit doesn't revert cleanly on top of 3.4.0-rc2, so I haven't
> tested that; but it looks like that caching code is in fact still useful
> to make "btrfs as root not be so damned slow."
> 

Ok can you give this a whirl?  You are going to have to boot/reboot a few times
to let the cache get re-generated again to make sure it's taken effect, but
hopefully this will help out.  Thanks,

Josef

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a844204..7a703d2 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -530,8 +530,8 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
 	 * we likely hold important locks.
 	 */
 	if (trans && (!trans->transaction->in_commit) &&
-	    (root && root != root->fs_info->tree_root) &&
-	    btrfs_test_opt(root, SPACE_CACHE)) {
+	    root != fs_info->tree_root &&
+	    fs_info->mount_opt & BTRFS_MOUNT_SPACE_CACHE) {
 		ret = load_free_space_cache(fs_info, cache);
 
 		spin_lock(&cache->lock);

  parent reply	other threads:[~2012-04-09 20:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 15:53 Boot speed/mount time regression with 3.4.0-rc2 Calvin Walton
2012-04-09 16:08 ` cwillu
2012-04-09 17:10 ` Calvin Walton
2012-04-09 17:14   ` Josef Bacik
2012-04-09 20:54   ` Josef Bacik [this message]
2012-04-09 21:20     ` Calvin Walton
2012-04-10 13:08       ` Josef Bacik
2012-04-10 15:16       ` Josef Bacik
2012-04-10 16:04         ` Calvin Walton
2012-04-10 16:29           ` David Sterba
2012-04-10 16:34             ` Calvin Walton
2012-04-11 15:26         ` Ahmet Inan
2012-04-11 17:04           ` Josef Bacik
2012-04-12  9:22             ` Ahmet Inan
2012-04-12 13:37               ` Josef Bacik
2012-04-12 14:23                 ` Josef Bacik
2012-04-13  6:26                   ` Ahmet Inan
2012-04-13  6:49                     ` cwillu
2012-04-13 11:22                       ` Ahmet Inan
     [not found]                         ` <CAFDW0jKMEQ+oMN41euh1cMy4h+6Qntt5UL9+0HZw4r9SpDJVvQ@mail.gmail.com>
2012-04-13 12:57                           ` cwillu
2012-04-13 13:20                             ` Ahmet Inan
2012-04-13 13:47                           ` Josef Bacik
2012-04-21 20:54                             ` Ahmet Inan
2012-04-22  7:59                               ` Sergei Trofimovich
2012-04-22  9:16                                 ` Ahmet Inan
2012-04-22 13:57                                   ` Ahmet Inan
2012-05-03 13:40                               ` Ahmet Inan
2012-04-11 16:38 ` Chester
2012-04-11 18:24   ` Josef Bacik

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=20120409205429.GB6958@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=calvin.walton@kepstin.ca \
    --cc=chris.mason@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;
as well as URLs for NNTP newsgroup(s).