Re: Odp: Re: Odp: Btrfs might be gradually slowing the boot process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 8, 2013 at 1:46 PM, Hugo Mills <hugo@xxxxxxxxxxxxx> wrote:
> On Fri, Nov 08, 2013 at 08:37:37PM +0100, yzb3@xxxxx wrote:
>> Sure;
>>
>> the kernel line from grub.cfg:
>> linux   /boot/vmlinuz-linux root=UUID=c26e6d9a-0bbb-436a-a217-95c738b5b9c6 rootflags=noatime,space_cache rw quiet
>
>    OK, this may be your problem. You're generating the space cache
> every time you boot. You only need it once; let the disk activity on
> boot finish (it may take a while, depending on how big your filesystem
> is, and how much data it has, and how fragmented it is), and remove
> the space_cache option from your rootflags. When you next boot, it
> will use the existing cache rather than generating it again from
> scratch.

While it's true you only need to mount with it once, mounting with
space_cache will only generate it if it doesn't already exist.  The
existence of a valid space cache generation in the super actually
enables exactly the same flag that space_cache/no_space_cache toggles,
in the very same function as the mount option is checked (this is
basically how the "you only need to mount with it once" magic is
implemented).

super.c:
int btrfs_parse_options(struct btrfs_root *root, char *options)
{
    ...
    cache_gen = btrfs_super_cache_generation(root->fs_info->super_copy);
    if (cache_gen)
        btrfs_set_opt(info->mount_opt, SPACE_CACHE);
    ...
    case Opt_space_cache:
        btrfs_set_opt(info->mount_opt, SPACE_CACHE);
        break;
    ...
}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux