[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180126224720.7331-1-xiyou.wangcong@gmail.com>
Date: Fri, 26 Jan 2018 14:47:20 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Cong Wang <xiyou.wangcong@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Tejun Heo <tj@...nel.org>
Subject: [PATCH] kernfs: account kernfs_node_cache as reclaimable
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@...uxfoundation.org>
Cc: Tejun Heo <tj@...nel.org>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.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
Powered by blists - more mailing lists