]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 31 Jan 2025 22:27:57 +0000 (22:27 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:55:15 +0000 (13:55 +0100)
commit9933e05f508e08ff9054d859c6736234f8d3700f
tree244524900b972e758b2ff069472efa1e5ab4441f
parent58ecedab080c41b7ecbb9f38d81d35a169738b82
f2fs: add a sysfs entry to reclaim POSIX_FADV_NOREUSE pages

[ Upstream commit a907f3a68ee26ba493a08a958809208d17f3347e ]

1. fadvise(fd1, POSIX_FADV_NOREUSE, {0,3});
2. fadvise(fd2, POSIX_FADV_NOREUSE, {1,2});
3. fadvise(fd3, POSIX_FADV_NOREUSE, {3,1});
4. echo 1024 > /sys/fs/f2fs/tuning/reclaim_caches_kb

This gives a way to reclaim file-backed pages by iterating all f2fs mounts until
reclaiming 1MB page cache ranges, registered by #1, #2, and #3.

5. cat /sys/fs/f2fs/tuning/reclaim_caches_kb
-> gives total number of registered file ranges.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: e462fc48ceb8 ("f2fs: maintain one time GC mode is enabled during whole zoned GC cycle")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/ABI/testing/sysfs-fs-f2fs
fs/f2fs/f2fs.h
fs/f2fs/shrinker.c
fs/f2fs/sysfs.c