[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240413155603.617554-1-haifeng.xu@shopee.com>
Date: Sat, 13 Apr 2024 15:56:03 +0000
From: Haifeng Xu <haifeng.xu@...pee.com>
To: cl@...ux.com,
	vbabka@...e.cz,
	willy@...radead.org
Cc: penberg@...nel.org,
	rientjes@...gle.com,
	iamjoonsoo.kim@....com,
	akpm@...ux-foundation.org,
	roman.gushchin@...ux.dev,
	42.hyeyoo@...il.com,
	linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Haifeng Xu <haifeng.xu@...pee.com>
Subject: [PATCH] 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@...pee.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
 mm/slub.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index e7bf1a1a31a8..49a3ebefab86 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4461,9 +4461,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;
-- 
2.25.1
Powered by blists - more mailing lists
 
