aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2024-05-02 16:10:39 +0200
committerVlastimil Babka <vbabka@suse.cz>2024-05-02 16:10:39 +0200
commit4a8dd3b3d55099efba5d98975ebf78c05e52d1ab (patch)
tree928d5a684ee266900ff1b83842ef7c20ffdb8c0e
parentb70391e3df806839a83d111302f3c1fa073e5dd0 (diff)
parent7338999ca3468404f547b1540211114cbdb26d06 (diff)
downloadslab/for-next.tar.gz
Merge branch 'slab/for-6.10/cleanup' into slab/for-nextslab/for-next
-rw-r--r--mm/slab_common.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 67c03d6bd26cfb..c37f8c41ffb00b 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -916,22 +916,15 @@ void __init create_kmalloc_caches(void)
* Including KMALLOC_CGROUP if CONFIG_MEMCG_KMEM defined
*/
for (type = KMALLOC_NORMAL; type < NR_KMALLOC_TYPES; type++) {
- for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++) {
- if (!kmalloc_caches[type][i])
- new_kmalloc_cache(i, type);
-
- /*
- * Caches that are not of the two-to-the-power-of size.
- * These have to be created immediately after the
- * earlier power of two caches
- */
- if (KMALLOC_MIN_SIZE <= 32 && i == 6 &&
- !kmalloc_caches[type][1])
- new_kmalloc_cache(1, type);
- if (KMALLOC_MIN_SIZE <= 64 && i == 7 &&
- !kmalloc_caches[type][2])
- new_kmalloc_cache(2, type);
- }
+ /* Caches that are NOT of the two-to-the-power-of size. */
+ if (KMALLOC_MIN_SIZE <= 32)
+ new_kmalloc_cache(1, type);
+ if (KMALLOC_MIN_SIZE <= 64)
+ new_kmalloc_cache(2, type);
+
+ /* Caches that are of the two-to-the-power-of size. */
+ for (i = KMALLOC_SHIFT_LOW; i <= KMALLOC_SHIFT_HIGH; i++)
+ new_kmalloc_cache(i, type);
}
#ifdef CONFIG_RANDOM_KMALLOC_CACHES
random_kmalloc_seed = get_random_u64();