Skip to content

btrfs: some fixes/updates for the extent map shrinker

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: use delayed iput during extent map shrinkingfs/btrfs/extent_map.c+1 -10 replies
2/3btrfs: stop extent map shrinker if reschedule is neededfs/btrfs/extent_map.c+31 -80 replies
3/3btrfs: avoid races when tracking progress for extent map shrinkingfs/btrfs/disk-io.c fs/btrfs/extent_map.c fs/btrfs/fs.h +1 more+76 -290 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid SterbaJosef Bacik
SeriesR-b
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 6.10 0/3] btrfs: some fixes/updates for the extent map shrinker

From: Filipe Manana <[email protected]>

A few fixes for the extent map shrinker that fix some reports from users where their desktops became very unresponsive.

Several notes here:

1) The first patch was already sent before to the list and it's in for-next already. It's unrelated to the reports from those users but it's related to a report from syzbot for a deadlock in case the shrinker does an iput on an inode with 0 links that needs to be deleted, and when the inode still has links but it's dirty, it can make the iput wait for writeback to complete, slowing down the shrinker. I've included it here just to group things in a logical way;

2) These patches apply to 6.10-rc;

3) At least the first 2 patches should go to 6.10 final IMO;

4) In case they land in 6.10-rc, then for-next needs to be rebased since there are minor and trivial conflicts to solve due to the last patch in for-next that reduces the size of struct btrfs_inode down to 1024 bytes.

Also the following patch which landed on for-next should be dropped because it's made obsolete by the second patch in this patchset:

https://lore.kernel.org/linux-btrfs/cb12212b9c599817507f3978c9102767267625b2.1719825714.git.fdmanana@suse.com/

5) There will be further improvements to the shrinker, namely to reduce the latency of finding open inodes in a root, but those will come later and may be too much for 6.10 final. It would also require different patch versions for 6.10 and 6.11 (for-next) since in the former we use a rbtree while in the later we have a xarray now.

Thanks.

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(-)
Signature · 1 line
2.43.0