From: Cong Wang <xiyou.wangcong@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Cong Wang <xiyou.wangcong@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>
Subject: [PATCH] kernfs: account kernfs_node_cache as reclaimable
Date: Fri, 26 Jan 2018 14:47:20 -0800 [thread overview]
Message-ID: <20180126224720.7331-1-xiyou.wangcong@gmail.com> (raw)
Similar to commit df206988e03e
("fs: fuse: account fuse_inode slab memory as reclaimable"), these
kernfs nodes are currently included in the unreclaimable slab counts -
SUnreclaim in /proc/meminfo. And they are reclaimable too and can be
freed by kernfs_evict_inode() via /proc/sys/vm/drop_caches easily.
Mark the slab cache reclaimable.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
fs/kernfs/mount.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c
index 26dd9a50f383..66a699d06c9a 100644
--- a/fs/kernfs/mount.c
+++ b/fs/kernfs/mount.c
@@ -411,6 +411,6 @@ void __init kernfs_init(void)
kernfs_node_cache = kmem_cache_create("kernfs_node_cache",
sizeof(struct kernfs_node),
0,
- SLAB_PANIC | SLAB_TYPESAFE_BY_RCU,
+ SLAB_PANIC | SLAB_TYPESAFE_BY_RCU | SLAB_RECLAIM_ACCOUNT,
NULL);
}
--
2.13.0
next reply other threads:[~2018-01-26 22:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 22:47 Cong Wang [this message]
2018-01-29 19:13 ` Tejun Heo
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=20180126224720.7331-1-xiyou.wangcong@gmail.com \
--to=xiyou.wangcong@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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
Powered by JetHome