mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
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>
This commit is contained in:
parent
5aa5c7b9a0
commit
5b15f3fb89
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue