From: fdmanana@kernel.org
To: linux-btrfs@vger.kernel.org
Cc: josef@toxicpanda.com, Filipe Manana <fdmanana@suse.com>
Subject: [PATCH v2 0/6] btrfs: speedup directory logging/fsync by copying index keys only
Date: Mon, 25 Oct 2021 17:31:48 +0100 [thread overview]
Message-ID: <cover.1635178668.git.fdmanana@suse.com> (raw)
In-Reply-To: <cover.1635155473.git.fdmanana@suse.com>
From: Filipe Manana <fdmanana@suse.com>
This patchset reworks directory logging to make it copy only the dir index
keys, instead of copying both dir index keys and dir item keys, as both have
the same type of information. This reduces the amount of logged metadata by
about half, and therefore we do about half of the cpu bound work, half of
the IO and use less log tree space (except for very small directories).
This will allow other optimizations to build on top, some of which are only
possible after this change, while others become easier and less cumbersome
to implement after this change. Performance tests are in the changelog of
patch 5/6. Patch 6/6 only removes code that deals with dir item keys when
replaying directory deletions and it could have been squashed into patch
5/6, but since that one is already large and works without 6/6, I opted
to make it separate to make it easier to review.
Also, after this change we are still able to correctly replay a log tree
generated by an old kernel, and an old kernel is also able to correctly
replay a log tree generated by a kernel that has this patchset applied.
I'm sending this close to the 5.16 merge window, but my intention is to
have it only for the next merge window (5.17).
V2: Updated changelog of patch 5/6 to make it more clear why backward
and forward compatibility are guaranteed.
Filipe Manana (6):
btrfs: remove root argument from drop_one_dir_item()
btrfs: remove root argument from btrfs_unlink_inode()
btrfs: remove root argument from add_link()
btrfs: remove root argument from check_item_in_log()
btrfs: only copy dir index keys when logging a directory
btrfs: remove no longer needed logic for replaying directory deletes
fs/btrfs/btrfs_inode.h | 18 +-
fs/btrfs/ctree.h | 1 -
fs/btrfs/inode.c | 25 +-
fs/btrfs/tree-log.c | 582 ++++++++++++++------------------
include/uapi/linux/btrfs_tree.h | 4 +-
5 files changed, 280 insertions(+), 350 deletions(-)
--
2.33.0
next prev parent reply other threads:[~2021-10-25 16:32 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 9:56 [PATCH 0/6] btrfs: speedup directory logging/fsync by copying index keys only fdmanana
2021-10-25 9:56 ` [PATCH 1/6] btrfs: remove root argument from drop_one_dir_item() fdmanana
2021-10-25 9:56 ` [PATCH 2/6] btrfs: remove root argument from btrfs_unlink_inode() fdmanana
2021-10-25 9:56 ` [PATCH 3/6] btrfs: remove root argument from add_link() fdmanana
2021-10-25 9:56 ` [PATCH 4/6] btrfs: remove root argument from check_item_in_log() fdmanana
2021-10-25 9:56 ` [PATCH 5/6] btrfs: only copy dir index keys when logging a directory fdmanana
2021-10-25 15:36 ` Josef Bacik
2021-10-25 16:01 ` Filipe Manana
2021-10-25 16:06 ` Josef Bacik
2021-10-25 9:56 ` [PATCH 6/6] btrfs: remove no longer needed logic for replaying directory deletes fdmanana
2021-10-25 16:31 ` fdmanana [this message]
2021-10-25 16:31 ` [PATCH v2 1/6] btrfs: remove root argument from drop_one_dir_item() fdmanana
2021-10-25 16:31 ` [PATCH v2 2/6] btrfs: remove root argument from btrfs_unlink_inode() fdmanana
2021-10-25 16:31 ` [PATCH v2 3/6] btrfs: remove root argument from add_link() fdmanana
2021-10-25 16:31 ` [PATCH v2 4/6] btrfs: remove root argument from check_item_in_log() fdmanana
2021-10-25 16:31 ` [PATCH v2 5/6] btrfs: only copy dir index keys when logging a directory fdmanana
2021-10-25 16:31 ` [PATCH v2 6/6] btrfs: remove no longer needed logic for replaying directory deletes fdmanana
2021-10-25 18:59 ` [PATCH v2 0/6] btrfs: speedup directory logging/fsync by copying index keys only Josef Bacik
2021-10-25 19:55 ` David Sterba
2021-10-26 9:43 ` Filipe Manana
2021-11-04 19:31 ` David Sterba
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.1635178668.git.fdmanana@suse.com \
--to=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--cc=josef@toxicpanda.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