summaryrefslogtreecommitdiffstats
path: root/include/linux/slab.h
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2022-11-15 18:19:28 +0100
committerVlastimil Babka <vbabka@suse.cz>2022-11-27 23:39:02 +0100
commit2f7c1c1396b587e8cfe18a1f0d628cedaae56b6a (patch)
tree07ff897f37d474d647c40a582a95d2ab450078c3 /include/linux/slab.h
parent90ce872c22b248724d1c87232410e3b38536e107 (diff)
downloadlinux-2f7c1c1396b587e8cfe18a1f0d628cedaae56b6a.tar.gz
linux-2f7c1c1396b587e8cfe18a1f0d628cedaae56b6a.tar.bz2
linux-2f7c1c1396b587e8cfe18a1f0d628cedaae56b6a.zip
mm, slub: don't create kmalloc-rcl caches with CONFIG_SLUB_TINY
Distinguishing kmalloc(__GFP_RECLAIMABLE) can help against fragmentation by grouping pages by mobility, but on tiny systems the extra memory overhead of separate set of kmalloc-rcl caches will probably be worse, and mobility grouping likely disabled anyway. Thus with CONFIG_SLUB_TINY, don't create kmalloc-rcl caches and use the regular ones. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Acked-by: Mike Rapoport <rppt@linux.ibm.com> Reviewed-by: Christoph Lameter <cl@linux.com>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r--include/linux/slab.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 45efc6c553b8..ae2d19ec8467 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -336,13 +336,18 @@ enum kmalloc_cache_type {
#endif
#ifndef CONFIG_MEMCG_KMEM
KMALLOC_CGROUP = KMALLOC_NORMAL,
-#else
- KMALLOC_CGROUP,
#endif
+#ifdef CONFIG_SLUB_TINY
+ KMALLOC_RECLAIM = KMALLOC_NORMAL,
+#else
KMALLOC_RECLAIM,
+#endif
#ifdef CONFIG_ZONE_DMA
KMALLOC_DMA,
#endif
+#ifdef CONFIG_MEMCG_KMEM
+ KMALLOC_CGROUP,
+#endif
NR_KMALLOC_TYPES
};