lkml.org 
[lkml]   [2018]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] kernfs: account kernfs_node_cache as reclaimable
Date
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
\
 
 \ /
  Last update: 2018-01-26 23:48    [W:0.028 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site