summaryrefslogtreecommitdiff
path: root/mm/slub.c
diff options
context:
space:
mode:
authorHaifeng Xu <haifeng.xu@shopee.com>2024-04-13 15:56:03 +0000
committerVlastimil Babka <vbabka@suse.cz>2024-04-15 16:50:28 +0200
commit5b15f3fb89fc23b52c3cf33e76a1ada83108b438 (patch)
tree688d7224f7f387d4824ddcedf29ce2a0eb8b7c22 /mm/slub.c
parent5aa5c7b9a09dfce2761c46579cc421708492e890 (diff)
downloadlwn-5b15f3fb89fc23b52c3cf33e76a1ada83108b438.tar.gz
lwn-5b15f3fb89fc23b52c3cf33e76a1ada83108b438.zip
slub: Set __GFP_COMP in kmem_cache by default
Now the __GFP_COMP is set only if the higher-order is not 0. However, __GFP_COMP flag can be set unconditionally because compound page can not be created in the order-0 case. And this can also simplify the code a bit (no need to check the order is 0 or not). Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/slub.c b/mm/slub.c
index a30bd2157c07..62a0bb2c3147 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5089,9 +5089,7 @@ static int calculate_sizes(struct kmem_cache *s)
if ((int)order < 0)
return 0;
- s->allocflags = 0;
- if (order)
- s->allocflags |= __GFP_COMP;
+ s->allocflags = __GFP_COMP;
if (s->flags & SLAB_CACHE_DMA)
s->allocflags |= GFP_DMA;