Whamcloud - gitweb
LU-12313 llite: Mark lustre_inode_cache as reclaimable
[fs/lustre-release.git] / lustre / llite / super25.c
index 82fa1f2..bf3a131 100644 (file)
@@ -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);