linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs: speedup and avoid inode logging during rename/link
@ 2022-01-20 11:00 fdmanana
  2022-01-20 11:00 ` [PATCH 1/6] btrfs: add helper to delete a dir entry from a log tree fdmanana
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: fdmanana @ 2022-01-20 11:00 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

Often rename and link operations need to update inodes that were logged
before, and often they trigger inode logging when it's not possible to
quickly determine if the inode was previously logged in the current
transaction.

This patchset speedups renames either by updating more efficiently a
previously logged directory or by avoiding triggering inode logging when
not needed. This can make all the difference, specially before all the
recent massive optimizations to directory logging between 5.16, upcoming
5.17 and other other changes in misc-next.

An openSUSE Tumbleweed user recently ran into an issue where package
installation/upgrades with the zypper tool were very slow, and it turned
out zypper was spending over 99% of its time on rename operations, which
were doing directory logging, and some of the packages required renaming
over 1700 files. The issue only happened on a 5.15 kernel, and it was
indirectly caused by excessive inode eviction, happening almost 100x more
when compared to 5.13, 5.14 and 5.16-rc[6,7,8] kernels. That in turn
resulted in logging inodes during renames when that would not happen if
inode eviction hadn't happen. More details on the changelogs of patches
3/6 to 5/6.

Filipe Manana (6):
  btrfs: add helper to delete a dir entry from a log tree
  btrfs: pass the dentry to btrfs_log_new_name() instead of the inode
  btrfs: avoid logging all directory changes during renames
  btrfs: stop doing unnecessary log updates during a rename
  btrfs: avoid inode logging during rename and link when possible
  btrfs: use single variable to track return value at btrfs_log_inode()

 fs/btrfs/inode.c    | 177 ++++++------------
 fs/btrfs/tree-log.c | 431 +++++++++++++++++++++++++++++++-------------
 fs/btrfs/tree-log.h |   7 +-
 3 files changed, 364 insertions(+), 251 deletions(-)

-- 
2.33.0


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

end of thread, other threads:[~2022-02-02 16:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-20 11:00 [PATCH 0/6] btrfs: speedup and avoid inode logging during rename/link fdmanana
2022-01-20 11:00 ` [PATCH 1/6] btrfs: add helper to delete a dir entry from a log tree fdmanana
2022-01-20 11:00 ` [PATCH 2/6] btrfs: pass the dentry to btrfs_log_new_name() instead of the inode fdmanana
2022-01-20 11:00 ` [PATCH 3/6] btrfs: avoid logging all directory changes during renames fdmanana
2022-01-20 11:00 ` [PATCH 4/6] btrfs: stop doing unnecessary log updates during a rename fdmanana
2022-01-20 11:00 ` [PATCH 5/6] btrfs: avoid inode logging during rename and link when possible fdmanana
2022-02-02 16:49   ` Filipe Manana
2022-01-20 11:00 ` [PATCH 6/6] btrfs: use single variable to track return value at btrfs_log_inode() fdmanana
2022-01-25 17:42 ` [PATCH 0/6] btrfs: speedup and avoid inode logging during rename/link 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).