linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] btrfs: some more speedups for directory logging/fsync
@ 2021-12-15 12:19 fdmanana
  2021-12-15 12:19 ` [PATCH 1/4] btrfs: don't log unnecessary boundary keys when logging directory fdmanana
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fdmanana @ 2021-12-15 12:19 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

This patchset brings some more performance improvements for directory
logging/fsync, by doing some changes to the logging algorithm to avoid
logging dentries created in past transactions, which helps reducing a
lot the amount of logged metadata, and therefore less IO as well for
large directories.

It specially benefits the case when some dentries were removed, either
due to file deletes or renames, where it can reduce the total time spent
in an fsync by an order of magnitude even if the number of dentries removed
is a small percentage of the total dentries in the directory (for e.g. as
little as 1%, like in the test results of the changelog of patch 3/4).

This builds on top of my previous patchset to make directory logging copy
only dir index keys and skip dir item keys, which has been on misc-next
since the previous merge window closed.

Patches 1/4 and 3/4 are the changes that accomplish this, while patch 2/4
is just preparation for patch 3/4, and patch 4/4 is more of a cleanup of
old, unnecessary and unreliable logic. Test case generic/335 was recently
updated in fstests, so that after applying patch 4/4 it passes.

Patch 3/4 contains in its changelog the test and results.

We are close to the 5.17 merge window, holiday season is approaching and
there's already a significant change for directory logging coming to 5.17
(log only dir index keys and skip dir item keys), so I think this patchset
is better suited for the 5.18 merge window.

Thanks.

Filipe Manana (4):
  btrfs: don't log unnecessary boundary keys when logging directory
  btrfs: put initial index value of a directory in a constant
  btrfs: stop copying old dir items when logging a directory
  btrfs: stop trying to log subdirectories created in past transactions

 fs/btrfs/btrfs_inode.h |  12 +++-
 fs/btrfs/inode.c       |  10 +---
 fs/btrfs/tree-log.c    | 123 +++++++++++++++++++++++++----------------
 3 files changed, 86 insertions(+), 59 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-01-06 15:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 12:19 [PATCH 0/4] btrfs: some more speedups for directory logging/fsync fdmanana
2021-12-15 12:19 ` [PATCH 1/4] btrfs: don't log unnecessary boundary keys when logging directory fdmanana
2021-12-15 12:19 ` [PATCH 2/4] btrfs: put initial index value of a directory in a constant fdmanana
2021-12-15 12:20 ` [PATCH 3/4] btrfs: stop copying old dir items when logging a directory fdmanana
2021-12-15 12:20 ` [PATCH 4/4] btrfs: stop trying to log subdirectories created in past transactions fdmanana
2022-01-06 15:31 ` [PATCH 0/4] btrfs: some more speedups for directory logging/fsync David Sterba

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