Message ID | 4cc5819796bd2af6de78b7a1919b4f8ed02b985f.1681180159.git.wqu@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: move block-group-tree out of experimental features | expand |
On Mon, Apr 10, 2023 at 10:37 PM Qu Wenruo <wqu@suse.com> wrote: > > The feedback from the community on block group tree is very positive, > the only complain is, end users need to recompile btrfs-progs with > experimental features to enjoy the new feature. > > So let's move it out of experimental features and let more people enjoy > faster mount speed. > > Also change the option of btrfstune, from `-b` to > `--enable-block-group-tree` to avoid short option. > > Signed-off-by: Qu Wenruo <wqu@suse.com> > --- > Documentation/btrfs-man5.rst | 6 ++++++ > Documentation/btrfstune.rst | 4 ++-- > Documentation/mkfs.btrfs.rst | 5 +++++ > common/fsfeatures.c | 4 +--- > tune/main.c | 18 ++++++++---------- > 5 files changed, 22 insertions(+), 15 deletions(-) > > diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst > index b50064fe9931..c625a9585457 100644 > --- a/Documentation/btrfs-man5.rst > +++ b/Documentation/btrfs-man5.rst > @@ -66,6 +66,12 @@ big_metadata > the filesystem uses *nodesize* for metadata blocks, this can be bigger than the > page size > > +block_group_tree > + (since: 6.1) > + > + block group item representation using a dedicated b-tree, this can greatly > + reduce mount time for large filesystems. > + > compress_lzo > (since: 2.6.38) > > diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst > index f4400f1f527a..c84c1e7e7092 100644 > --- a/Documentation/btrfstune.rst > +++ b/Documentation/btrfstune.rst > @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>` > OPTIONS > ------- > > --b > - (since kernel 6.1, needs experimental build of btrfs-progs) > +--enable-block-group-tree > + (since kernel 6.1) > Enable block group tree feature (greatly reduce mount time), > enabled by mkfs feature *block-group-tree*. > I think it would make more sense to declare version 6.3 as the version here, since it would effectively be the first version where it's not experimental anymore. > diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst > index e80f4c5c83ee..fe52f4406bf2 100644 > --- a/Documentation/mkfs.btrfs.rst > +++ b/Documentation/mkfs.btrfs.rst > @@ -283,6 +283,11 @@ free-space-tree > Enable the free space tree (mount option *space_cache=v2*) for persisting the > free space cache. > > +block-group-tree > + (kernel support since 6.1) > + > + Enable the block group tree to greatly reduce mount time for large filesystems. > + Ditto. > BLOCK GROUPS, CHUNKS, RAID > -------------------------- > > diff --git a/common/fsfeatures.c b/common/fsfeatures.c > index 4aca96f6e4fe..50500c652265 100644 > --- a/common/fsfeatures.c > +++ b/common/fsfeatures.c > @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { > .desc = "support zoned devices" > }, > #endif > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > +#if EXPERIMENTAL > { > .name = "extent-tree-v2", > .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, > @@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_TO_STRING2(default, 5,15), > .desc = "free space tree (space_cache=v2)" > }, > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > -#endif > /* Keep this one last */ > { > .name = "list-all", > diff --git a/tune/main.c b/tune/main.c > index c5d2e37aef3d..f5a94cdbdb5f 100644 > --- a/tune/main.c > +++ b/tune/main.c > @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { > OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"), > OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"), > OPTLINE("-S <0|1>", "set/unset seeding status of a device"), > + OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > "", > "UUID changes:", > OPTLINE("-u", "rewrite fsid, use a random one"), > @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { > "", > "EXPERIMENTAL FEATURES:", > OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"), > - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > #endif > NULL > }; > @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > btrfs_config_init(); > > while(1) { > - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; > + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; > static const struct option long_options[] = { > { "help", no_argument, NULL, GETOPT_VAL_HELP}, > + { "enable-block-group-tree", no_argument, NULL, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, > #if EXPERIMENTAL > { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, > #endif > { NULL, 0, NULL, 0 } > }; > -#if EXPERIMENTAL > - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL); > -#else > int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); > -#endif > > if (c < 0) > break; > switch(c) { > - case 'b': > - btrfs_warn_experimental("Feature: conversion to block-group-tree"); > - to_bg_tree = true; > - break; > case 'S': > seeding_flag = 1; > seeding_value = arg_strtou64(optarg); > @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; > change_metadata_uuid = 1; > break; > + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: > + to_bg_tree = true; > + break; > #if EXPERIMENTAL > case GETOPT_VAL_CSUM: > btrfs_warn_experimental( > -- > 2.39.2 >
On 2023/4/12 09:49, Neal Gompa wrote: > On Mon, Apr 10, 2023 at 10:37 PM Qu Wenruo <wqu@suse.com> wrote: >> >> The feedback from the community on block group tree is very positive, >> the only complain is, end users need to recompile btrfs-progs with >> experimental features to enjoy the new feature. >> >> So let's move it out of experimental features and let more people enjoy >> faster mount speed. >> >> Also change the option of btrfstune, from `-b` to >> `--enable-block-group-tree` to avoid short option. >> >> Signed-off-by: Qu Wenruo <wqu@suse.com> >> --- >> Documentation/btrfs-man5.rst | 6 ++++++ >> Documentation/btrfstune.rst | 4 ++-- >> Documentation/mkfs.btrfs.rst | 5 +++++ >> common/fsfeatures.c | 4 +--- >> tune/main.c | 18 ++++++++---------- >> 5 files changed, 22 insertions(+), 15 deletions(-) >> >> diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst >> index b50064fe9931..c625a9585457 100644 >> --- a/Documentation/btrfs-man5.rst >> +++ b/Documentation/btrfs-man5.rst >> @@ -66,6 +66,12 @@ big_metadata >> the filesystem uses *nodesize* for metadata blocks, this can be bigger than the >> page size >> >> +block_group_tree >> + (since: 6.1) >> + >> + block group item representation using a dedicated b-tree, this can greatly >> + reduce mount time for large filesystems. >> + >> compress_lzo >> (since: 2.6.38) >> >> diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst >> index f4400f1f527a..c84c1e7e7092 100644 >> --- a/Documentation/btrfstune.rst >> +++ b/Documentation/btrfstune.rst >> @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>` >> OPTIONS >> ------- >> >> --b >> - (since kernel 6.1, needs experimental build of btrfs-progs) >> +--enable-block-group-tree >> + (since kernel 6.1) >> Enable block group tree feature (greatly reduce mount time), >> enabled by mkfs feature *block-group-tree*. >> > > I think it would make more sense to declare version 6.3 as the version > here, since it would effectively be the first version where it's not > experimental anymore. Here we're talking about kernel support, which is indeed 6.1. For progs, it's much simpler, if it's not documented in man page, then it's not supported, thus we don't really bother mentioning the prog version. Thanks, Qu > >> diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst >> index e80f4c5c83ee..fe52f4406bf2 100644 >> --- a/Documentation/mkfs.btrfs.rst >> +++ b/Documentation/mkfs.btrfs.rst >> @@ -283,6 +283,11 @@ free-space-tree >> Enable the free space tree (mount option *space_cache=v2*) for persisting the >> free space cache. >> >> +block-group-tree >> + (kernel support since 6.1) >> + >> + Enable the block group tree to greatly reduce mount time for large filesystems. >> + > > Ditto. > >> BLOCK GROUPS, CHUNKS, RAID >> -------------------------- >> >> diff --git a/common/fsfeatures.c b/common/fsfeatures.c >> index 4aca96f6e4fe..50500c652265 100644 >> --- a/common/fsfeatures.c >> +++ b/common/fsfeatures.c >> @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { >> .desc = "support zoned devices" >> }, >> #endif >> -#if EXPERIMENTAL >> { >> .name = "block-group-tree", >> .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, >> @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { >> VERSION_NULL(default), >> .desc = "block group tree to reduce mount time" >> }, >> +#if EXPERIMENTAL >> { >> .name = "extent-tree-v2", >> .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, >> @@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = { >> VERSION_TO_STRING2(default, 5,15), >> .desc = "free space tree (space_cache=v2)" >> }, >> -#if EXPERIMENTAL >> { >> .name = "block-group-tree", >> .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, >> @@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = { >> VERSION_NULL(default), >> .desc = "block group tree to reduce mount time" >> }, >> -#endif >> /* Keep this one last */ >> { >> .name = "list-all", >> diff --git a/tune/main.c b/tune/main.c >> index c5d2e37aef3d..f5a94cdbdb5f 100644 >> --- a/tune/main.c >> +++ b/tune/main.c >> @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { >> OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"), >> OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"), >> OPTLINE("-S <0|1>", "set/unset seeding status of a device"), >> + OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"), >> "", >> "UUID changes:", >> OPTLINE("-u", "rewrite fsid, use a random one"), >> @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { >> "", >> "EXPERIMENTAL FEATURES:", >> OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"), >> - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"), >> #endif >> NULL >> }; >> @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) >> btrfs_config_init(); >> >> while(1) { >> - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; >> + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, >> + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; >> static const struct option long_options[] = { >> { "help", no_argument, NULL, GETOPT_VAL_HELP}, >> + { "enable-block-group-tree", no_argument, NULL, >> + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, >> #if EXPERIMENTAL >> { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, >> #endif >> { NULL, 0, NULL, 0 } >> }; >> -#if EXPERIMENTAL >> - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL); >> -#else >> int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); >> -#endif >> >> if (c < 0) >> break; >> switch(c) { >> - case 'b': >> - btrfs_warn_experimental("Feature: conversion to block-group-tree"); >> - to_bg_tree = true; >> - break; >> case 'S': >> seeding_flag = 1; >> seeding_value = arg_strtou64(optarg); >> @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) >> ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; >> change_metadata_uuid = 1; >> break; >> + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: >> + to_bg_tree = true; >> + break; >> #if EXPERIMENTAL >> case GETOPT_VAL_CSUM: >> btrfs_warn_experimental( >> -- >> 2.39.2 >> > >
On 4/11/23 08:01, Qu Wenruo wrote: > The feedback from the community on block group tree is very positive, > the only complain is, end users need to recompile btrfs-progs with > experimental features to enjoy the new feature. > > So let's move it out of experimental features and let more people enjoy > faster mount speed. > > Also change the option of btrfstune, from `-b` to > `--enable-block-group-tree` to avoid short option. What is the tradeoff for the desktop use case (lets say 1TB disksize) if the block-group-tree is made the default option? And add btrfstune --disable-bg instead. Thanks, Anand > > Signed-off-by: Qu Wenruo <wqu@suse.com> > --- > Documentation/btrfs-man5.rst | 6 ++++++ > Documentation/btrfstune.rst | 4 ++-- > Documentation/mkfs.btrfs.rst | 5 +++++ > common/fsfeatures.c | 4 +--- > tune/main.c | 18 ++++++++---------- > 5 files changed, 22 insertions(+), 15 deletions(-) > > diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst > index b50064fe9931..c625a9585457 100644 > --- a/Documentation/btrfs-man5.rst > +++ b/Documentation/btrfs-man5.rst > @@ -66,6 +66,12 @@ big_metadata > the filesystem uses *nodesize* for metadata blocks, this can be bigger than the > page size > > +block_group_tree > + (since: 6.1) > + > + block group item representation using a dedicated b-tree, this can greatly > + reduce mount time for large filesystems. > + > compress_lzo > (since: 2.6.38) > > diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst > index f4400f1f527a..c84c1e7e7092 100644 > --- a/Documentation/btrfstune.rst > +++ b/Documentation/btrfstune.rst > @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>` > OPTIONS > ------- > > --b > - (since kernel 6.1, needs experimental build of btrfs-progs) > +--enable-block-group-tree > + (since kernel 6.1) > Enable block group tree feature (greatly reduce mount time), > enabled by mkfs feature *block-group-tree*. > > diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst > index e80f4c5c83ee..fe52f4406bf2 100644 > --- a/Documentation/mkfs.btrfs.rst > +++ b/Documentation/mkfs.btrfs.rst > @@ -283,6 +283,11 @@ free-space-tree > Enable the free space tree (mount option *space_cache=v2*) for persisting the > free space cache. > > +block-group-tree > + (kernel support since 6.1) > + > + Enable the block group tree to greatly reduce mount time for large filesystems. > + > BLOCK GROUPS, CHUNKS, RAID > -------------------------- > > diff --git a/common/fsfeatures.c b/common/fsfeatures.c > index 4aca96f6e4fe..50500c652265 100644 > --- a/common/fsfeatures.c > +++ b/common/fsfeatures.c > @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { > .desc = "support zoned devices" > }, > #endif > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > +#if EXPERIMENTAL > { > .name = "extent-tree-v2", > .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, > @@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_TO_STRING2(default, 5,15), > .desc = "free space tree (space_cache=v2)" > }, > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > -#endif > /* Keep this one last */ > { > .name = "list-all", > diff --git a/tune/main.c b/tune/main.c > index c5d2e37aef3d..f5a94cdbdb5f 100644 > --- a/tune/main.c > +++ b/tune/main.c > @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { > OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"), > OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"), > OPTLINE("-S <0|1>", "set/unset seeding status of a device"), > + OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > "", > "UUID changes:", > OPTLINE("-u", "rewrite fsid, use a random one"), > @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { > "", > "EXPERIMENTAL FEATURES:", > OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"), > - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > #endif > NULL > }; > @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > btrfs_config_init(); > > while(1) { > - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; > + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; > static const struct option long_options[] = { > { "help", no_argument, NULL, GETOPT_VAL_HELP}, > + { "enable-block-group-tree", no_argument, NULL, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, > #if EXPERIMENTAL > { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, > #endif > { NULL, 0, NULL, 0 } > }; > -#if EXPERIMENTAL > - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL); > -#else > int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); > -#endif > > if (c < 0) > break; > switch(c) { > - case 'b': > - btrfs_warn_experimental("Feature: conversion to block-group-tree"); > - to_bg_tree = true; > - break; > case 'S': > seeding_flag = 1; > seeding_value = arg_strtou64(optarg); > @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; > change_metadata_uuid = 1; > break; > + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: > + to_bg_tree = true; > + break; > #if EXPERIMENTAL > case GETOPT_VAL_CSUM: > btrfs_warn_experimental(
On Thu, Apr 13, 2023 at 05:54:01PM +0530, Anand Jain wrote: > On 4/11/23 08:01, Qu Wenruo wrote: > > The feedback from the community on block group tree is very positive, > > the only complain is, end users need to recompile btrfs-progs with > > experimental features to enjoy the new feature. > > > > So let's move it out of experimental features and let more people enjoy > > faster mount speed. > > > > > > Also change the option of btrfstune, from `-b` to > > `--enable-block-group-tree` to avoid short option. > > What is the tradeoff for the desktop use case (lets say 1TB disksize) > if the block-group-tree is made the default option? And add btrfstune > --disable-bg instead. On a 1TB disk the difference is probably not that big, the long mount times were reported on larger filesystems and bgt is advertisied as help on many-terabyte filesystems. It's a vague statement because we don't know the exact value but from 4T on it would probably make more sense. Another thing, block-group-tree is not going to be default yet, it's being moved from experimental features, i.e. generally available by default. When we're going to make it default is not known yet. Conversion from bgt to extent tree is something I asked for but it's not a priority in case bgt is not default so we don't have --disable-bg.
On 2023/4/13 20:24, Anand Jain wrote: > On 4/11/23 08:01, Qu Wenruo wrote: >> The feedback from the community on block group tree is very positive, >> the only complain is, end users need to recompile btrfs-progs with >> experimental features to enjoy the new feature. >> >> So let's move it out of experimental features and let more people enjoy >> faster mount speed. >> > > >> Also change the option of btrfstune, from `-b` to >> `--enable-block-group-tree` to avoid short option. > > What is the tradeoff for the desktop use case (lets say 1TB disksize) > if the block-group-tree is made the default option? And add btrfstune > --disable-bg instead. No tradeoff except compatibility I can tell. For --disable-bg, as far as I know everyone going bg tree is happy, thus never considered going back. Furthermore, since it's compat_ro, older kernel can still mount with rescue=all to read out the data. Thanks, Qu > > Thanks, Anand > > >> >> Signed-off-by: Qu Wenruo <wqu@suse.com> >> --- >> Documentation/btrfs-man5.rst | 6 ++++++ >> Documentation/btrfstune.rst | 4 ++-- >> Documentation/mkfs.btrfs.rst | 5 +++++ >> common/fsfeatures.c | 4 +--- >> tune/main.c | 18 ++++++++---------- >> 5 files changed, 22 insertions(+), 15 deletions(-) >> >> diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst >> index b50064fe9931..c625a9585457 100644 >> --- a/Documentation/btrfs-man5.rst >> +++ b/Documentation/btrfs-man5.rst >> @@ -66,6 +66,12 @@ big_metadata >> the filesystem uses *nodesize* for metadata blocks, this can >> be bigger than the >> page size >> +block_group_tree >> + (since: 6.1) >> + >> + block group item representation using a dedicated b-tree, >> this can greatly >> + reduce mount time for large filesystems. >> + >> compress_lzo >> (since: 2.6.38) >> diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst >> index f4400f1f527a..c84c1e7e7092 100644 >> --- a/Documentation/btrfstune.rst >> +++ b/Documentation/btrfstune.rst >> @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in >> :doc:`btrfs(5)<btrfs-man5>` >> OPTIONS >> ------- >> --b >> - (since kernel 6.1, needs experimental build of btrfs-progs) >> +--enable-block-group-tree >> + (since kernel 6.1) >> Enable block group tree feature (greatly reduce mount time), >> enabled by mkfs feature *block-group-tree*. >> diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst >> index e80f4c5c83ee..fe52f4406bf2 100644 >> --- a/Documentation/mkfs.btrfs.rst >> +++ b/Documentation/mkfs.btrfs.rst >> @@ -283,6 +283,11 @@ free-space-tree >> Enable the free space tree (mount option *space_cache=v2*) >> for persisting the >> free space cache. >> +block-group-tree >> + (kernel support since 6.1) >> + >> + Enable the block group tree to greatly reduce mount time for >> large filesystems. >> + >> BLOCK GROUPS, CHUNKS, RAID >> -------------------------- >> diff --git a/common/fsfeatures.c b/common/fsfeatures.c >> index 4aca96f6e4fe..50500c652265 100644 >> --- a/common/fsfeatures.c >> +++ b/common/fsfeatures.c >> @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { >> .desc = "support zoned devices" >> }, >> #endif >> -#if EXPERIMENTAL >> { >> .name = "block-group-tree", >> .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, >> @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { >> VERSION_NULL(default), >> .desc = "block group tree to reduce mount time" >> }, >> +#if EXPERIMENTAL >> { >> .name = "extent-tree-v2", >> .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, >> @@ -222,7 +222,6 @@ static const struct btrfs_feature >> runtime_features[] = { >> VERSION_TO_STRING2(default, 5,15), >> .desc = "free space tree (space_cache=v2)" >> }, >> -#if EXPERIMENTAL >> { >> .name = "block-group-tree", >> .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, >> @@ -232,7 +231,6 @@ static const struct btrfs_feature >> runtime_features[] = { >> VERSION_NULL(default), >> .desc = "block group tree to reduce mount time" >> }, >> -#endif >> /* Keep this one last */ >> { >> .name = "list-all", >> diff --git a/tune/main.c b/tune/main.c >> index c5d2e37aef3d..f5a94cdbdb5f 100644 >> --- a/tune/main.c >> +++ b/tune/main.c >> @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { >> OPTLINE("-x", "enable skinny metadata extent refs (mkfs: >> skinny-metadata)"), >> OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more >> efficient sparse file representation)"), >> OPTLINE("-S <0|1>", "set/unset seeding status of a device"), >> + OPTLINE("--enable-block-group-tree", "enable block group tree >> (mkfs: block-group-tree, for less mount time)"), >> "", >> "UUID changes:", >> OPTLINE("-u", "rewrite fsid, use a random one"), >> @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { >> "", >> "EXPERIMENTAL FEATURES:", >> OPTLINE("--csum CSUM", "switch checksum for data and metadata to >> CSUM"), >> - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, >> for less mount time)"), >> #endif >> NULL >> }; >> @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) >> btrfs_config_init(); >> while(1) { >> - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; >> + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, >> + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; >> static const struct option long_options[] = { >> { "help", no_argument, NULL, GETOPT_VAL_HELP}, >> + { "enable-block-group-tree", no_argument, NULL, >> + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, >> #if EXPERIMENTAL >> { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, >> #endif >> { NULL, 0, NULL, 0 } >> }; >> -#if EXPERIMENTAL >> - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", >> long_options, NULL); >> -#else >> int c = getopt_long(argc, argv, "S:rxfuU:nmM:", >> long_options, NULL); >> -#endif >> if (c < 0) >> break; >> switch(c) { >> - case 'b': >> - btrfs_warn_experimental("Feature: conversion to >> block-group-tree"); >> - to_bg_tree = true; >> - break; >> case 'S': >> seeding_flag = 1; >> seeding_value = arg_strtou64(optarg); >> @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) >> ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; >> change_metadata_uuid = 1; >> break; >> + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: >> + to_bg_tree = true; >> + break; >> #if EXPERIMENTAL >> case GETOPT_VAL_CSUM: >> btrfs_warn_experimental( >
On 11/4/23 10:31, Qu Wenruo wrote: > The feedback from the community on block group tree is very positive, > the only complain is, end users need to recompile btrfs-progs with > experimental features to enjoy the new feature. > > So let's move it out of experimental features and let more people enjoy > faster mount speed. > > Also change the option of btrfstune, from `-b` to > `--enable-block-group-tree` to avoid short option. > > Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Thanks, Anand > --- > Documentation/btrfs-man5.rst | 6 ++++++ > Documentation/btrfstune.rst | 4 ++-- > Documentation/mkfs.btrfs.rst | 5 +++++ > common/fsfeatures.c | 4 +--- > tune/main.c | 18 ++++++++---------- > 5 files changed, 22 insertions(+), 15 deletions(-) > > diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst > index b50064fe9931..c625a9585457 100644 > --- a/Documentation/btrfs-man5.rst > +++ b/Documentation/btrfs-man5.rst > @@ -66,6 +66,12 @@ big_metadata > the filesystem uses *nodesize* for metadata blocks, this can be bigger than the > page size > > +block_group_tree > + (since: 6.1) > + > + block group item representation using a dedicated b-tree, this can greatly > + reduce mount time for large filesystems. > + > compress_lzo > (since: 2.6.38) > > diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst > index f4400f1f527a..c84c1e7e7092 100644 > --- a/Documentation/btrfstune.rst > +++ b/Documentation/btrfstune.rst > @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>` > OPTIONS > ------- > > --b > - (since kernel 6.1, needs experimental build of btrfs-progs) > +--enable-block-group-tree > + (since kernel 6.1) > Enable block group tree feature (greatly reduce mount time), > enabled by mkfs feature *block-group-tree*. > > diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst > index e80f4c5c83ee..fe52f4406bf2 100644 > --- a/Documentation/mkfs.btrfs.rst > +++ b/Documentation/mkfs.btrfs.rst > @@ -283,6 +283,11 @@ free-space-tree > Enable the free space tree (mount option *space_cache=v2*) for persisting the > free space cache. > > +block-group-tree > + (kernel support since 6.1) > + > + Enable the block group tree to greatly reduce mount time for large filesystems. > + > BLOCK GROUPS, CHUNKS, RAID > -------------------------- > > diff --git a/common/fsfeatures.c b/common/fsfeatures.c > index 4aca96f6e4fe..50500c652265 100644 > --- a/common/fsfeatures.c > +++ b/common/fsfeatures.c > @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { > .desc = "support zoned devices" > }, > #endif > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > +#if EXPERIMENTAL > { > .name = "extent-tree-v2", > .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, > @@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_TO_STRING2(default, 5,15), > .desc = "free space tree (space_cache=v2)" > }, > -#if EXPERIMENTAL > { > .name = "block-group-tree", > .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, > @@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = { > VERSION_NULL(default), > .desc = "block group tree to reduce mount time" > }, > -#endif > /* Keep this one last */ > { > .name = "list-all", > diff --git a/tune/main.c b/tune/main.c > index c5d2e37aef3d..f5a94cdbdb5f 100644 > --- a/tune/main.c > +++ b/tune/main.c > @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { > OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"), > OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"), > OPTLINE("-S <0|1>", "set/unset seeding status of a device"), > + OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > "", > "UUID changes:", > OPTLINE("-u", "rewrite fsid, use a random one"), > @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { > "", > "EXPERIMENTAL FEATURES:", > OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"), > - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"), > #endif > NULL > }; > @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > btrfs_config_init(); > > while(1) { > - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; > + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; > static const struct option long_options[] = { > { "help", no_argument, NULL, GETOPT_VAL_HELP}, > + { "enable-block-group-tree", no_argument, NULL, > + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, > #if EXPERIMENTAL > { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, > #endif > { NULL, 0, NULL, 0 } > }; > -#if EXPERIMENTAL > - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL); > -#else > int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); > -#endif > > if (c < 0) > break; > switch(c) { > - case 'b': > - btrfs_warn_experimental("Feature: conversion to block-group-tree"); > - to_bg_tree = true; > - break; > case 'S': > seeding_flag = 1; > seeding_value = arg_strtou64(optarg); > @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) > ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; > change_metadata_uuid = 1; > break; > + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: > + to_bg_tree = true; > + break; > #if EXPERIMENTAL > case GETOPT_VAL_CSUM: > btrfs_warn_experimental(
diff --git a/Documentation/btrfs-man5.rst b/Documentation/btrfs-man5.rst index b50064fe9931..c625a9585457 100644 --- a/Documentation/btrfs-man5.rst +++ b/Documentation/btrfs-man5.rst @@ -66,6 +66,12 @@ big_metadata the filesystem uses *nodesize* for metadata blocks, this can be bigger than the page size +block_group_tree + (since: 6.1) + + block group item representation using a dedicated b-tree, this can greatly + reduce mount time for large filesystems. + compress_lzo (since: 2.6.38) diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst index f4400f1f527a..c84c1e7e7092 100644 --- a/Documentation/btrfstune.rst +++ b/Documentation/btrfstune.rst @@ -24,8 +24,8 @@ means. Please refer to the *FILESYSTEM FEATURES* in :doc:`btrfs(5)<btrfs-man5>` OPTIONS ------- --b - (since kernel 6.1, needs experimental build of btrfs-progs) +--enable-block-group-tree + (since kernel 6.1) Enable block group tree feature (greatly reduce mount time), enabled by mkfs feature *block-group-tree*. diff --git a/Documentation/mkfs.btrfs.rst b/Documentation/mkfs.btrfs.rst index e80f4c5c83ee..fe52f4406bf2 100644 --- a/Documentation/mkfs.btrfs.rst +++ b/Documentation/mkfs.btrfs.rst @@ -283,6 +283,11 @@ free-space-tree Enable the free space tree (mount option *space_cache=v2*) for persisting the free space cache. +block-group-tree + (kernel support since 6.1) + + Enable the block group tree to greatly reduce mount time for large filesystems. + BLOCK GROUPS, CHUNKS, RAID -------------------------- diff --git a/common/fsfeatures.c b/common/fsfeatures.c index 4aca96f6e4fe..50500c652265 100644 --- a/common/fsfeatures.c +++ b/common/fsfeatures.c @@ -171,7 +171,6 @@ static const struct btrfs_feature mkfs_features[] = { .desc = "support zoned devices" }, #endif -#if EXPERIMENTAL { .name = "block-group-tree", .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, @@ -181,6 +180,7 @@ static const struct btrfs_feature mkfs_features[] = { VERSION_NULL(default), .desc = "block group tree to reduce mount time" }, +#if EXPERIMENTAL { .name = "extent-tree-v2", .incompat_flag = BTRFS_FEATURE_INCOMPAT_EXTENT_TREE_V2, @@ -222,7 +222,6 @@ static const struct btrfs_feature runtime_features[] = { VERSION_TO_STRING2(default, 5,15), .desc = "free space tree (space_cache=v2)" }, -#if EXPERIMENTAL { .name = "block-group-tree", .compat_ro_flag = BTRFS_FEATURE_COMPAT_RO_BLOCK_GROUP_TREE, @@ -232,7 +231,6 @@ static const struct btrfs_feature runtime_features[] = { VERSION_NULL(default), .desc = "block group tree to reduce mount time" }, -#endif /* Keep this one last */ { .name = "list-all", diff --git a/tune/main.c b/tune/main.c index c5d2e37aef3d..f5a94cdbdb5f 100644 --- a/tune/main.c +++ b/tune/main.c @@ -70,6 +70,7 @@ static const char * const tune_usage[] = { OPTLINE("-x", "enable skinny metadata extent refs (mkfs: skinny-metadata)"), OPTLINE("-n", "enable no-holes feature (mkfs: no-holes, more efficient sparse file representation)"), OPTLINE("-S <0|1>", "set/unset seeding status of a device"), + OPTLINE("--enable-block-group-tree", "enable block group tree (mkfs: block-group-tree, for less mount time)"), "", "UUID changes:", OPTLINE("-u", "rewrite fsid, use a random one"), @@ -84,7 +85,6 @@ static const char * const tune_usage[] = { "", "EXPERIMENTAL FEATURES:", OPTLINE("--csum CSUM", "switch checksum for data and metadata to CSUM"), - OPTLINE("-b", "enable block group tree (mkfs: block-group-tree, for less mount time)"), #endif NULL }; @@ -113,27 +113,22 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) btrfs_config_init(); while(1) { - enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST }; + enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE }; static const struct option long_options[] = { { "help", no_argument, NULL, GETOPT_VAL_HELP}, + { "enable-block-group-tree", no_argument, NULL, + GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE}, #if EXPERIMENTAL { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, #endif { NULL, 0, NULL, 0 } }; -#if EXPERIMENTAL - int c = getopt_long(argc, argv, "S:rxfuU:nmM:b", long_options, NULL); -#else int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); -#endif if (c < 0) break; switch(c) { - case 'b': - btrfs_warn_experimental("Feature: conversion to block-group-tree"); - to_bg_tree = true; - break; case 'S': seeding_flag = 1; seeding_value = arg_strtou64(optarg); @@ -167,6 +162,9 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) ctree_flags |= OPEN_CTREE_IGNORE_FSID_MISMATCH; change_metadata_uuid = 1; break; + case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: + to_bg_tree = true; + break; #if EXPERIMENTAL case GETOPT_VAL_CSUM: btrfs_warn_experimental(
The feedback from the community on block group tree is very positive, the only complain is, end users need to recompile btrfs-progs with experimental features to enjoy the new feature. So let's move it out of experimental features and let more people enjoy faster mount speed. Also change the option of btrfstune, from `-b` to `--enable-block-group-tree` to avoid short option. Signed-off-by: Qu Wenruo <wqu@suse.com> --- Documentation/btrfs-man5.rst | 6 ++++++ Documentation/btrfstune.rst | 4 ++-- Documentation/mkfs.btrfs.rst | 5 +++++ common/fsfeatures.c | 4 +--- tune/main.c | 18 ++++++++---------- 5 files changed, 22 insertions(+), 15 deletions(-)