mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernfs: account kernfs_node_cache as reclaimable
@ 2018-01-26 22:47 Cong Wang
  2018-01-29 19:13 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2018-01-26 22:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Cong Wang, Greg Kroah-Hartman, Tejun Heo

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernfs: account kernfs_node_cache as reclaimable
  2018-01-26 22:47 [PATCH] kernfs: account kernfs_node_cache as reclaimable Cong Wang
@ 2018-01-29 19:13 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2018-01-29 19:13 UTC (permalink / raw)
  To: Cong Wang; +Cc: linux-kernel, Greg Kroah-Hartman

On Fri, Jan 26, 2018 at 02:47:20PM -0800, Cong Wang wrote:
> 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.

That evicts the inode, not the kernfs_node.  kernfs_node is the
backing storage for these filesystems.  They aren't reclaimable.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-29 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-26 22:47 [PATCH] kernfs: account kernfs_node_cache as reclaimable Cong Wang
2018-01-29 19:13 ` Tejun Heo

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