[GIT PULL] Btrfs fixes for 6.10-rc8

From: David Sterba
Date: Fri Jul 12 2024 - 14:48:51 EST


Hi,

please pull the following branch that fixes a regression in extent map
shrinker behaviour.

In the past weeks we got reports from users that there are huge latency
spikes or freezes. This was bisected to newly added shrinker of extent
maps (it was added to fix a build up of the structures in memory).

I'm assuming that the freezes would happen to many users after release
so I'd like to get it merged now so it's in 6.10. Although the diff
size is not small the changes are relatively straightforward, the
reporters verified the fixes and we did testing on our side.

Please pull, thanks.

The fixes:

- adjust behaviour under memory pressure and check lock or scheduling
conditions, bail out if needed

- synchronize tracking of the scanning progress so inode ranges are not
skipped or work duplicated

- do a delayed iput when scanning a root so evicting an inode does not
slow things down in case of lots of dirty data, also fix lockdep
warning, a deadlock could happen when writing the dirty data would
need to start a transaction

----------------------------------------------------------------
The following changes since commit a56c85fa2d59ab0780514741550edf87989a66e9:

btrfs: fix folio refcount in __alloc_dummy_extent_buffer() (2024-07-04 02:19:10 +0200)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git tags/for-6.10-rc7-tag

for you to fetch changes up to 4484940514295b75389f94787f8e179ba6255353:

btrfs: avoid races when tracking progress for extent map shrinking (2024-07-11 16:50:54 +0200)

----------------------------------------------------------------
Filipe Manana (3):
btrfs: use delayed iput during extent map shrinking
btrfs: stop extent map shrinker if reschedule is needed
btrfs: avoid races when tracking progress for extent map shrinking

fs/btrfs/disk-io.c | 2 +
fs/btrfs/extent_map.c | 123 +++++++++++++++++++++++++++++++++----------
fs/btrfs/fs.h | 1 +
include/trace/events/btrfs.h | 18 ++++---
4 files changed, 107 insertions(+), 37 deletions(-)