Whamcloud - gitweb
LU-13134 obdclass: use slab allocation for cl_page
[fs/lustre-release.git] / lustre / obdclass / cl_object.c
index 1e39da3..9844ed0 100644 (file)
@@ -58,6 +58,8 @@
 
 static struct kmem_cache *cl_env_kmem;
 struct kmem_cache *cl_dio_aio_kmem;
+struct kmem_cache *cl_page_kmem_array[16];
+unsigned short cl_page_kmem_size_array[16];
 
 /** Lock class of cl_object_header::coh_attr_guard */
 static struct lock_class_key cl_attr_guard_class;
@@ -1106,6 +1108,14 @@ out:
  */
 void cl_global_fini(void)
 {
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(cl_page_kmem_array); i++) {
+               if (cl_page_kmem_array[i]) {
+                       kmem_cache_destroy(cl_page_kmem_array[i]);
+                       cl_page_kmem_array[i] = NULL;
+               }
+       }
        cl_env_percpu_fini();
        lu_context_key_degister(&cl_key);
        lu_kmem_fini(cl_object_caches);