mbox series

[0/6] btrfs: speedup directory logging/fsync by copying index keys only

Message ID cover.1635155473.git.fdmanana@suse.com (mailing list archive)
Headers show
Series btrfs: speedup directory logging/fsync by copying index keys only | expand

Message

Filipe Manana Oct. 25, 2021, 9:56 a.m. UTC
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).

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(-)