flags |= SLAB_CACHE_DMA;
        }
 
-       kmalloc_caches[type][idx] = create_kmalloc_cache(
-                                       kmalloc_info[idx].name[type],
-                                       kmalloc_info[idx].size, flags, 0,
-                                       kmalloc_info[idx].size);
-
        /*
         * If CONFIG_MEMCG_KMEM is enabled, disable cache merging for
         * KMALLOC_NORMAL caches.
         */
        if (IS_ENABLED(CONFIG_MEMCG_KMEM) && (type == KMALLOC_NORMAL))
-               kmalloc_caches[type][idx]->refcount = -1;
+               flags |= SLAB_NO_MERGE;
+
+       kmalloc_caches[type][idx] = create_kmalloc_cache(
+                                       kmalloc_info[idx].name[type],
+                                       kmalloc_info[idx].size, flags, 0,
+                                       kmalloc_info[idx].size);
 }
 
 /*