Skip to content

add support for drop_caches for individual filesystem

Ye Bin linux-fsdevel linux-mm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 12 repliesIn review
  2. v23 patches 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm/vmscan: introduce drop_sb_dentry_inode() helperinclude/linux/mm.h mm/internal.h mm/shrinker.c +1 more+56 -20 replies
2/3sysctl: add support for drop_caches for individual filesystemfs/drop_caches.c+125 -00 replies
3/3Documentation: add instructions for using 'drop_fs_caches sysctl' sysctlDocumentation/admin-guide/sysctl/vm.rst+44 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/3] add support for drop_caches for individual filesystem

From: Ye Bin <[email protected]>

In order to better analyze the issue of file system uninstallation caused by kernel module opening files, it is necessary to perform dentry recycling on a single file system. But now, apart from global dentry recycling, it is not supported to do dentry recycling on a single file system separately. This feature has usage scenarios in problem localization scenarios.At the same time, it also provides users with a slightly fine-grained pagecache/entry recycling mechanism.
This patchset supports the recycling of pagecache/entry for individual file systems.

Diff v3 vs v2
1. Introduce introduce drop_sb_dentry_inode() helper instead of reclaim_dcache_sb()/reclaim_icache_sb() helper for reclaim dentry/inode.
2. Fixing compilation issues in specific architectures and configurations.

Diff v2 vs v1:
1. Fix possible live lock for shrink_icache_sb().
2. Introduce reclaim_dcache_sb() for reclaim dentry.
3. Fix potential deadlocks as follows:
https://lore.kernel.org/linux-fsdevel/[email protected]/
After some consideration, it was decided that this feature would primarily be used for debugging purposes. Instead of adding a new IOCTL command, the task_work mechanism was employed to address potential deadlock issues.

Ye Bin (3):
mm/vmscan: introduce drop_sb_dentry_inode() helper
sysctl: add support for drop_caches for individual filesystem
Documentation: add instructions for using 'drop_fs_caches sysctl'
sysctl

 Documentation/admin-guide/sysctl/vm.rst |  44 +++++++++
 fs/drop_caches.c                        | 125 ++++++++++++++++++++++++
 include/linux/mm.h                      |   1 +
 mm/internal.h                           |   3 +
 mm/shrinker.c                           |   4 +-
 mm/vmscan.c                             |  50 ++++++++++
 6 files changed, 225 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1