From: Ye Bin <yebin@huaweicloud.com>
To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
linux-fsdevel@vger.kernel.org
Cc: akpm@linux-foundation.org, david@fromorbit.com,
zhengqi.arch@bytedance.com, roman.gushchin@linux.dev,
muchun.song@linux.dev, linux-mm@kvack.org, yebin10@huawei.com
Subject: [PATCH v3 3/3] Documentation: add instructions for using 'drop_fs_caches sysctl' sysctl
Date: Fri, 27 Feb 2026 10:55:48 +0800 [thread overview]
Message-ID: <20260227025548.2252380-4-yebin@huaweicloud.com> (raw)
In-Reply-To: <20260227025548.2252380-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 | 44 +++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
index 97e12359775c..76545da53e20 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
@@ -286,6 +287,49 @@ 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 error messages in your kernel log when incorrect path or device
+number provided::
+
+ echo (1234): drop_fs_caches: failed to get path(/mnt/XX) ERRNO
+Or
+ echo (1234): drop_fs_caches: failed to get dev(MAJOR:MINOR)'s sb
+
+You may see informational messages in your kernel log when this file is
+used::
+
+ echo (1234): drop_fs_caches: 3 MAJOR:MINOR
+
+These are informational only. They do not mean that anything is wrong
+with your system. To disable them, echo 4 (bit 2) into drop_fs_caches.
+
enable_soft_offline
===================
Correctable memory errors are very common on servers. Soft-offline is kernel's
--
2.34.1
next prev parent reply other threads:[~2026-02-27 2:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 2:55 [PATCH v3 0/3] add support for drop_caches for individual filesystem Ye Bin
2026-02-27 2:55 ` [PATCH v3 1/3] mm/vmscan: introduce drop_sb_dentry_inode() helper Ye Bin
2026-02-27 2:55 ` [PATCH v3 2/3] sysctl: add support for drop_caches for individual filesystem Ye Bin
2026-02-27 2:55 ` Ye Bin [this message]
2026-02-27 3:31 ` [PATCH v3 0/3] " Muchun Song
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=20260227025548.2252380-4-yebin@huaweicloud.com \
--to=yebin@huaweicloud.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=viro@zeniv.linux.org.uk \
--cc=yebin10@huawei.com \
--cc=zhengqi.arch@bytedance.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox