btrfs: add a shrinker for extent maps
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest10 patches 10 repliesIn review
- v215 patches 9 repliesSuperseded
- v111 patches 5 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | btrfs: pass the extent map tree's inode to add_extent_mapping()fs/ | +16 | 1 reply | |
| 2/10 | btrfs: pass the extent map tree's inode to clear_em_logging()fs/ fs/ fs/ | +6 | 1 reply | |
| 3/10 | btrfs: pass the extent map tree's inode to remove_extent_mapping()fs/ fs/ fs/ +1 more | +25 | 1 reply | |
| 4/10 | btrfs: pass the extent map tree's inode to replace_extent_mapping()fs/ | +6 | 1 reply | |
| 5/10 | btrfs: pass the extent map tree's inode to setup_extent_mapping()fs/ | +5 | 1 reply | |
| 6/10 | btrfs: pass the extent map tree's inode to try_merge_map()fs/ | +6 | 1 reply | |
| 7/10 | btrfs: add a global per cpu counter to track number of used extent mapsfs/ fs/ fs/ | +28 | 1 reply | |
| 8/10 | btrfs: add a shrinker for extent mapsfs/ fs/ fs/ +1 more | +179 | 1 reply | |
| 9/10 | btrfs: update comment for btrfs_set_inode_full_sync() about lockingfs/ | +5 | 0 replies | |
| 10/10 | btrfs: add tracepoints for extent map shrinker eventsfs/ fs/ include/ | +116 | 2 replies |
Reviews trailers per patch
All 10 patches have a Reviewed-by or Acked-by.
| Patch | Qu Wenruo | Josef Bacik | Johannes Thumshirn |
|---|---|---|---|
| 1/10 | R-b | R-b | R-b |
| 2/10 | R-b | R-b | R-b |
| 3/10 | R-b | R-b | R-b |
| 4/10 | R-b | R-b | R-b |
| 5/10 | R-b | R-b | R-b |
| 6/10 | R-b | R-b | R-b |
| 7/10 | R-b | R-b | |
| 8/10 | R-b | ||
| 9/10 | R-b | ||
| 10/10 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v3 00/10] btrfs: add a shrinker for extent maps
From: Filipe Manana <[email protected]>
Currently we don't limit the amount of extent maps we can have for inodes from a subvolume tree, which can result in excessive use of memory and in some cases in running into OOM situations. This was reported some time ago by a user and it's specially easier to trigger with direct IO.
The shrinker itself is patch 08/10, what comes before is simple preparatory work and the rest just trace events. More details in the change logs.
V3: Removed some preparatory patches that are already in for-next.
Updated patch 07/10 to avoid a lockdep warning due to attempt to read the percpu counter when freeing fs_info if during the open_ctree() path we had an error before initializing the counter. Reported by the Intel test robot.
Update the shrinker patch (08/10) to use the nr_cached_objects and free_cached_objects callbacks of struct super_operations. Make the shrinker remember the last inode and root it processed, so that it starts from there the next time it runs.
Also avoid a deadlock when trying to lock the mmap lock, not use a down_read_trylock() and comment about it.
Avoid setting the inode full sync flag if an extent in the list of modified extents is from an older generation, whose transaction was already committed and therefore the file extent item was persisted.
V2: Split patch 09/11 into 3.
Added two patches to export and use helper to find inode in a root. Updated patch 13/15 to use the helper for finding next inode and removed the #ifdef for 32 bits case which is irrelevant as on 32 bits systems we can't ever have more than ULONG_MAX extent maps allocated.
Filipe Manana (10):
btrfs: pass the extent map tree's inode to add_extent_mapping()
btrfs: pass the extent map tree's inode to clear_em_logging()
btrfs: pass the extent map tree's inode to remove_extent_mapping()
btrfs: pass the extent map tree's inode to replace_extent_mapping()
btrfs: pass the extent map tree's inode to setup_extent_mapping()
btrfs: pass the extent map tree's inode to try_merge_map()
btrfs: add a global per cpu counter to track number of used extent maps
btrfs: add a shrinker for extent maps
btrfs: update comment for btrfs_set_inode_full_sync() about locking
btrfs: add tracepoints for extent map shrinker events
fs/btrfs/btrfs_inode.h | 8 +- fs/btrfs/disk-io.c | 9 + fs/btrfs/extent_io.c | 2 +- fs/btrfs/extent_map.c | 277 +++++++++++++++++++++++++----- fs/btrfs/extent_map.h | 5 +- fs/btrfs/fs.h | 4 + fs/btrfs/super.c | 20 +++ fs/btrfs/tests/extent-map-tests.c | 19 +- fs/btrfs/tree-log.c | 4 +- include/trace/events/btrfs.h | 99 +++++++++++ 10 files changed, 388 insertions(+), 59 deletions(-)
Signature · 1 line
2.43.0