From: Ye Bin <yebin@huaweicloud.com>
To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, yebin10@huawei.com
Subject: [PATCH v2 3/3] Documentation: add instructions for using 'drop_fs_caches sysctl' sysctl
Date: Mon, 17 Nov 2025 19:27:35 +0800 [thread overview]
Message-ID: <20251117112735.4170831-4-yebin@huaweicloud.com> (raw)
In-Reply-To: <20251117112735.4170831-1-yebin@huaweicloud.com>
From: Ye Bin <yebin10@huawei.com>
Add instructions for 'drop_fs_caches sysctl' sysctl in 'vm.rst'.
Signed-off-by: Ye Bin <yebin10@huawei.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
prev parent reply other threads:[~2025-11-17 11:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-17 11:27 [PATCH v2 0/3] add support for drop_caches for individual filesystem Ye Bin
2025-11-17 11:27 ` [PATCH v2 1/3] vfs: introduce reclaim_icache_sb() and reclaim_dcache_sb() helper Ye Bin
2025-11-17 11:27 ` [PATCH v2 2/3] sysctl: add support for drop_caches for individual filesystem Ye Bin
2025-11-17 13:57 ` kernel test robot
2025-11-17 14:07 ` kernel test robot
2025-11-17 11:27 ` Ye Bin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251117112735.4170831-4-yebin@huaweicloud.com \
--to=yebin@huaweicloud.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=yebin10@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.