Skip to content

Commit 5b15f3f

Browse files
hfxsptehcaster
authored andcommitted
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>
1 parent 5aa5c7b commit 5b15f3f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

mm/slub.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,9 +5089,7 @@ static int calculate_sizes(struct kmem_cache *s)
50895089
if ((int)order < 0)
50905090
return 0;
50915091

5092-
s->allocflags = 0;
5093-
if (order)
5094-
s->allocflags |= __GFP_COMP;
5092+
s->allocflags = __GFP_COMP;
50955093

50965094
if (s->flags & SLAB_CACHE_DMA)
50975095
s->allocflags |= GFP_DMA;

0 commit comments

Comments
 (0)