kernfs: account kernfs_node_cache as reclaimable
PATCH 1/1 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.
--- fs/kernfs/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/kernfs/mount.c +1 -1
@@ -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 ); }
Signature · 1 line
2.13.0
Tejun Heo
maintainerQuoted 5 lines · Cong Wang
Similar to commit
df206988e03e
("fs: fuse: accountfuse_inodeslab 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 bykernfs_evict_inode()via/proc/sys/vm/drop_cacheseasily.
That evicts the inode, not the kernfs_node. kernfs_node is the backing storage for these filesystems. They aren't reclaimable.
Thanks.
Signature · 1 line
tejun