linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 0/4] Fix for btrfs-convert chunk type and fsck support
Date: Thu, 24 Sep 2015 09:18:51 +0800	[thread overview]
Message-ID: <56034F7B.5050107@cn.fujitsu.com> (raw)
In-Reply-To: <20150911145638.GP8891@twin.jikos.cz>

Hi David,

After some ext* lecture given by my teammate, Wang Xiaoguang, I'm more 
convinced that, at least for convert from ext*, separate chunk type will 
not be a good idea.

[[Ext* file system struct]]

Unlike pure extent based file, ext* is block group based.
0		128M		256M		384M	...
| Group 0       | Group 1	| Group 2	|       ...

And in each group, the beginning part is always taken by its metadata.

So even for a empty group, it will have some used space:
For Group 1:
128M   128+4M				256M
|\\\\\\|				|

Fro Group 0, it has journal taken more space at beginning, for about 30+M.

So even for newly created ext4 fs, its available space map will be like 
the fowlloing:
0		128M		256M		384M	...
|\\\\|		|\\|		|\\|		|\\|	...

For separate chunk type, we must ensure all above used space be covered 
by DATA chunk.
On the other hand, we must alloc other METADATA/DATA chunk for btrfs 
metadata/data.

So the bad news is, if we follow that behavior, we will end up 
allocating at most 100+M metadata chunk.

For above almost empty ext4 case, it will cause less problem, as
we can batch several groups and put a large data chunk to cover them,
then allocate a 100+M metadata chunk.

0		128M		256M		384M	...
|\\\\|		|\\|		|\\|		|\\|	...
|<-----------DATA------------------->|<--META-->|
     (256 + 16)			       (128-16)

But if the filesystem is used and most group only has scattered 
available space, we may ended up unable to alloc any metadata chunk.

This will make the usage of limited block group quite limited.
Although I'll continue add such support for btrfs-convert, I'm quite 
concerned about the usage...

Thanks,
Qu

David Sterba wrote on 2015/09/11 16:56 +0200:
> On Thu, Sep 10, 2015 at 10:34:13AM +0800, Qu Wenruo wrote:
>> Again the buggy btrfs-convert, even David tried to ban mixed-bg features
>> for btrfs-convert, it will still put data and metadata extents into the
>> same chunk, without marking the chunk mixed.
>>
>> So in the patchset, first add fsck support for such problem, and then
>> force btrfs-convert to use mixed block group.
>
> I don't think this is a good option for now. People convert
> many-terabytes filesystems. Unless there's a way how to convert such
> filesystem to the split data/metadata type I don't want to force mixed
> bg to convert. The bug you describe is there, but I wonder why didn't
> we notice problems that arise from it.
>

  parent reply	other threads:[~2015-09-24  1:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  2:34 [PATCH 0/4] Fix for btrfs-convert chunk type and fsck support Qu Wenruo
2015-09-10  2:34 ` [PATCH v2 1/5] btrfs-progs: fsck: Add check for extent and parent chunk type Qu Wenruo
2015-09-10  2:34 ` [PATCH v2 2/5] btrfs-progs: utils: Check nodesize against features Qu Wenruo
2015-09-10  2:34 ` [PATCH v2 3/5] btrfs-progs: convert: force convert to used mixed block group Qu Wenruo
2015-09-10  2:34 ` [PATCH v2 4/5] btrfs-progs: util: add parameter for btrfs_list_all_fs_features Qu Wenruo
2015-09-10  2:37 ` [PATCH v2 5/5] btrfs-progs: convert-test: Disable different nodesize test Qu Wenruo
2015-09-11 14:56 ` [PATCH 0/4] Fix for btrfs-convert chunk type and fsck support David Sterba
2015-09-11 15:23   ` Qu Wenruo
2015-09-24  1:18   ` Qu Wenruo [this message]
2015-09-25 15:19     ` David Sterba
2015-09-26  7:56       ` Qu Wenruo
2015-09-29  9:31         ` David Sterba
2015-09-25 15:49 ` David Sterba
  -- strict thread matches above, loose matches on Subject: below --
2015-09-09  8:49 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=56034F7B.5050107@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --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).