All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs-progs: separate BLOCK_GROUP_TREE feature from extent-tree-v2
Date: Wed, 13 Jul 2022 15:57:40 +0800	[thread overview]
Message-ID: <cover.1657698964.git.wqu@suse.com> (raw)

The block group tree idea is introduced to greatly reduce mount time for
large fs, over SEVERN years ago.

And 4 years ago, it's determined to let extent-tree-v2 to implement the
feature.

However extent tree v2 still doesn't have a consistent on-disk format,
nor any implementation on the real extent items, nor any tests on some
independent sub-features.

I strongly doubt if that's a correct decision, especially considering
there is really no dependency from extent tree v2 on this block group
tree feature.

Not to mention this is against the common idea on progressive
improvement.

So now is the time to revive the independent block group compat RO flag.

[CHANGE FROM EXTENT-TREE-V2]
- Don't store block group root into super block
  There is no special reason for block group root to be stored in super
  block.

- Separate block-group-tree as a compat RO flag from extent-tree-v2
  The change to extent tree is not affecting read-only opeartions.
  No reason to make it incompat.

- Fix a bug in extent-tree-v2 which doesn't initialize block group item
  correctly.
  Since we're re-using the existing block group item structure, we
  should properly initialize chunk_objectid to 256, or tree block
  will reject it.

- Dynamically arrange the mkfs_block array
  Instead a completely new array dedicated for extent-tree-v2, now we
  have proper helpers to add/delete block from the array on-the-fly.

[TODO]
- Add btrfstune support to convert to block-group-tree feature
  and back.
  This is supported in previous push, but now due to the new
  changes introduced by extent-tree-v2, I need to revisit the
  convert tool.

  And due to recent inspirations from csum conversion, I will
  go the double tree co-exist method to do the conversion,
  instead of the old one transaction conversion.

Qu Wenruo (3):
  btrfs-progs: mkfs: dynamically modify mkfs blocks array
  btrfs-progs: don't save block group root into super block
  btrfs-progs: separate block group tree from extent tree v2

 check/main.c               |   8 +--
 cmds/inspect-dump-tree.c   |  11 ----
 common/fsfeatures.c        |   8 +++
 common/fsfeatures.h        |   2 +
 kernel-shared/ctree.h      |  35 +++---------
 kernel-shared/disk-io.c    |  77 ++++++-------------------
 kernel-shared/disk-io.h    |   2 +-
 kernel-shared/print-tree.c |  11 +---
 mkfs/common.c              | 113 ++++++++++++++++++++++++++++++-------
 mkfs/common.h              |  20 +------
 mkfs/main.c                |   3 +-
 11 files changed, 138 insertions(+), 152 deletions(-)

-- 
2.37.0


             reply	other threads:[~2022-07-13  7:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  7:57 Qu Wenruo [this message]
2022-07-13  7:57 ` [PATCH 1/3] btrfs-progs: mkfs: dynamically modify mkfs blocks array Qu Wenruo
2022-07-13  7:57 ` [PATCH 2/3] btrfs-progs: don't save block group root into super block Qu Wenruo
2022-07-13  7:57 ` [PATCH 3/3] btrfs-progs: separate block group tree from extent tree v2 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=cover.1657698964.git.wqu@suse.com \
    --to=wqu@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.