linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: only search higher order when fallback
@ 2022-08-03  2:51 Abel Wu
  2022-08-03  8:15 ` Vlastimil Babka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Abel Wu @ 2022-08-03  2:51 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Michal Hocko, Mel Gorman, Muchun Song
  Cc: linux-mm, linux-kernel, Abel Wu

It seems unnecessary to search pages with order < alloc_order in
fallback allocation.

Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index e008a3df0485..0abafc2fc3e0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2934,7 +2934,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype,
 	 * i.e. orders < pageblock_order. If there are no local zones free,
 	 * the zonelists will be reiterated without ALLOC_NOFRAGMENT.
 	 */
-	if (alloc_flags & ALLOC_NOFRAGMENT)
+	if (order < pageblock_order && alloc_flags & ALLOC_NOFRAGMENT)
 		min_order = pageblock_order;
 
 	/*
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: only search higher order when fallback
  2022-08-03  2:51 [PATCH] mm/page_alloc: only search higher order when fallback Abel Wu
@ 2022-08-03  8:15 ` Vlastimil Babka
  2022-08-04  5:36 ` Muchun Song
  2022-08-04  9:39 ` Mel Gorman
  2 siblings, 0 replies; 4+ messages in thread
From: Vlastimil Babka @ 2022-08-03  8:15 UTC (permalink / raw)
  To: Abel Wu, Andrew Morton, Michal Hocko, Mel Gorman, Muchun Song
  Cc: linux-mm, linux-kernel

On 8/3/22 04:51, Abel Wu wrote:
> It seems unnecessary to search pages with order < alloc_order in
> fallback allocation.

This can currently happen with ALLOC_NOFRAGMENT and alloc_order >
pageblock_order, so add a test to prevent it.

> Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index e008a3df0485..0abafc2fc3e0 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2934,7 +2934,7 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype,
>  	 * i.e. orders < pageblock_order. If there are no local zones free,
>  	 * the zonelists will be reiterated without ALLOC_NOFRAGMENT.
>  	 */
> -	if (alloc_flags & ALLOC_NOFRAGMENT)
> +	if (order < pageblock_order && alloc_flags & ALLOC_NOFRAGMENT)
>  		min_order = pageblock_order;
>  
>  	/*


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: only search higher order when fallback
  2022-08-03  2:51 [PATCH] mm/page_alloc: only search higher order when fallback Abel Wu
  2022-08-03  8:15 ` Vlastimil Babka
@ 2022-08-04  5:36 ` Muchun Song
  2022-08-04  9:39 ` Mel Gorman
  2 siblings, 0 replies; 4+ messages in thread
From: Muchun Song @ 2022-08-04  5:36 UTC (permalink / raw)
  To: Abel Wu
  Cc: Andrew Morton, Vlastimil Babka, Michal Hocko, Mel Gorman,
	Linux Memory Management List, LKML

On Wed, Aug 3, 2022 at 10:51 AM Abel Wu <wuyun.abel@bytedance.com> wrote:
>
> It seems unnecessary to search pages with order < alloc_order in
> fallback allocation.
>
> Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mm/page_alloc: only search higher order when fallback
  2022-08-03  2:51 [PATCH] mm/page_alloc: only search higher order when fallback Abel Wu
  2022-08-03  8:15 ` Vlastimil Babka
  2022-08-04  5:36 ` Muchun Song
@ 2022-08-04  9:39 ` Mel Gorman
  2 siblings, 0 replies; 4+ messages in thread
From: Mel Gorman @ 2022-08-04  9:39 UTC (permalink / raw)
  To: Abel Wu
  Cc: Andrew Morton, Vlastimil Babka, Michal Hocko, Muchun Song,
	linux-mm, linux-kernel

On Wed, Aug 03, 2022 at 10:51:21AM +0800, Abel Wu wrote:
> It seems unnecessary to search pages with order < alloc_order in
> fallback allocation.
> 
> Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-04  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03  2:51 [PATCH] mm/page_alloc: only search higher order when fallback Abel Wu
2022-08-03  8:15 ` Vlastimil Babka
2022-08-04  5:36 ` Muchun Song
2022-08-04  9:39 ` Mel Gorman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).