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 <jacek.tomaka@poczta.fm>
Change-Id: Iac526a62d0e063b82eea451d1fafa42f2bb4d3b8
Reviewed-on: https://review.whamcloud.com/35790
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
{
struct lnet_process_id lnet_id;
int i, rc;
{
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);
CLASSERT(sizeof(LUSTRE_VOLATILE_HDR) == LUSTRE_VOLATILE_HDR_LEN + 1);
CDEBUG(D_INFO, "Lustre client module (%p).\n",
&lustre_super_operations);
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),
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);
if (ll_inode_cachep == NULL)
GOTO(out_cache, rc = -ENOMEM);