[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251117112735.4170831-4-yebin@huaweicloud.com>
Date: Mon, 17 Nov 2025 19:27:35 +0800
From: Ye Bin <yebin@...weicloud.com>
To: viro@...iv.linux.org.uk,
brauner@...nel.org,
jack@...e.cz,
linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
yebin10@...wei.com
Subject: [PATCH v2 3/3] Documentation: add instructions for using 'drop_fs_caches sysctl' sysctl
From: Ye Bin <yebin10@...wei.com>
Add instructions for 'drop_fs_caches sysctl' sysctl in 'vm.rst'.
Signed-off-by: Ye Bin <yebin10@...wei.com>
---
Documentation/admin-guide/sysctl/vm.rst | 34 +++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
index ace73480eb9d..c6c29c8cf92e 100644
--- a/Documentation/admin-guide/sysctl/vm.rst
+++ b/Documentation/admin-guide/sysctl/vm.rst
@@ -37,6 +37,7 @@ Currently, these files are in /proc/sys/vm:
- dirtytime_expire_seconds
- dirty_writeback_centisecs
- drop_caches
+- drop_fs_caches
- enable_soft_offline
- extfrag_threshold
- highmem_is_dirtyable
@@ -284,6 +285,39 @@ used::
These are informational only. They do not mean that anything is wrong
with your system. To disable them, echo 4 (bit 2) into drop_caches.
+drop_fs_caches
+==============
+
+Writing to this will cause the kernel to drop clean for a specific file system
+caches, as well as reclaimable slab objects like dentries and inodes. Once
+dropped, their memory becomes free. Except for specifying the device number
+or file path for a specific file system, everything else is consistent with
+drop_caches. The device number can be viewed through "cat /proc/self/montinfo"
+or 'lsblk'.
+
+To free pagecache::
+
+ echo "1 MAJOR:MINOR" > /proc/sys/vm/drop_fs_caches
+Or
+ echo "1 /mnt/XX" > /proc/sys/vm/drop_fs_caches
+
+To free reclaimable slab objects (includes dentries and inodes)::
+
+ echo "2 MAJOR:MINOR" > /proc/sys/vm/drop_fs_caches
+Or
+ echo "2 /mnt/XX" > /proc/sys/vm/drop_fs_caches
+
+To free slab objects and pagecache::
+
+ echo "3 MAJOR:MINOR" > /proc/sys/vm/drop_fs_caches
+Or
+ echo "3 /mnt/XX" > /proc/sys/vm/drop_fs_caches
+
+You may see informational messages in your kernel log when this file is
+used::
+
+ echo (1234): drop_fs_caches: 3 MAJOR:MINOR
+
enable_soft_offline
===================
Correctable memory errors are very common on servers. Soft-offline is kernel's
--
2.34.1
Powered by blists - more mailing lists