From b09e63db24e5770b0a53ac6d68f91f08dc368be4 Mon Sep 17 00:00:00 2001 From: Jacek Tomaka Date: Sat, 18 May 2019 10:17:30 +0800 Subject: [PATCH] LU-12313 llite: Mark lustre_inode_cache as reclaimable This is required for proper kernel memory available accounting. Without it memory allocated to lustre_inode_cache appears as SUnreclaim where in reality it should apper as SReclaimable. This affect MemAvailable as well (it is lower than it should be). Signed-off-by: Jacek Tomaka Change-Id: Iac526a62d0e063b82eea451d1fafa42f2bb4d3b8 Reviewed-on: https://review.whamcloud.com/35790 Tested-by: jenkins Reviewed-by: Wang Shilong Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- lustre/llite/super25.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index 82fa1f2..bf3a131 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -87,6 +87,7 @@ static int __init lustre_init(void) { struct lnet_process_id lnet_id; int i, rc; + unsigned long lustre_inode_cache_flags; CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1); @@ -96,9 +97,15 @@ static int __init lustre_init(void) CDEBUG(D_INFO, "Lustre client module (%p).\n", &lustre_super_operations); + lustre_inode_cache_flags = SLAB_HWCACHE_ALIGN | SLAB_RECLAIM_ACCOUNT | + SLAB_MEM_SPREAD; +#ifdef SLAB_ACCOUNT + lustre_inode_cache_flags |= SLAB_ACCOUNT; +#endif + ll_inode_cachep = kmem_cache_create("lustre_inode_cache", sizeof(struct ll_inode_info), - 0, SLAB_HWCACHE_ALIGN, NULL); + 0, lustre_inode_cache_flags, NULL); if (ll_inode_cachep == NULL) GOTO(out_cache, rc = -ENOMEM); -- 1.8.3.1