linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Yajun Deng <yajun.deng@linux.dev>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Zi Yan <ziy@nvidia.com>, Mel Gorman <mgorman@techsingularity.net>,
	David Hildenbrand <david@redhat.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Acked-by@kvack.org:Mike Rapoport <rppt@linux.ibm.com>,
	Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH] mm/page_alloc: reduce fallbacks to (MIGRATE_PCPTYPES - 1)
Date: Fri, 3 Feb 2023 14:23:24 -0800	[thread overview]
Message-ID: <20230203142324.e5c0652990676ac69a4e5eb1@linux-foundation.org> (raw)
In-Reply-To: <20230203100132.1627787-1-yajun.deng@linux.dev>

On Fri,  3 Feb 2023 18:01:32 +0800 Yajun Deng <yajun.deng@linux.dev> wrote:

> The commit 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable
> pageblocks with others") has removed MIGRATE_CMA and MIGRATE_ISOLATE from
> fallbacks list. so there is no need to add an element at the end of every
> type.
> 
> Reduce fallbacks to (MIGRATE_PCPTYPES - 1).

Thanks.  `git log' suggests who should be cc'ed when fixing things...

> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2603,10 +2603,10 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
>   *
>   * The other migratetypes do not have fallbacks.
>   */
> -static int fallbacks[MIGRATE_TYPES][3] = {
> -	[MIGRATE_UNMOVABLE]   = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE,   MIGRATE_TYPES },
> -	[MIGRATE_MOVABLE]     = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_TYPES },
> -	[MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE,   MIGRATE_MOVABLE,   MIGRATE_TYPES },
> +static int fallbacks[MIGRATE_TYPES][MIGRATE_PCPTYPES - 1] = {
> +	[MIGRATE_UNMOVABLE]   = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE   },
> +	[MIGRATE_MOVABLE]     = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE },
> +	[MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE,   MIGRATE_MOVABLE   },
>  };
>  
>  #ifdef CONFIG_CMA
> @@ -2865,11 +2865,8 @@ int find_suitable_fallback(struct free_area *area, unsigned int order,
>  		return -1;
>  
>  	*can_steal = false;
> -	for (i = 0;; i++) {
> +	for (i = 0; i < MIGRATE_PCPTYPES - 1 ; i++) {
>  		fallback_mt = fallbacks[migratetype][i];
> -		if (fallback_mt == MIGRATE_TYPES)
> -			break;
> -
>  		if (free_area_empty(area, fallback_mt))
>  			continue;
>  
> -- 
> 2.25.1


  reply	other threads:[~2023-02-03 22:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 10:01 Yajun Deng
2023-02-03 22:23 ` Andrew Morton [this message]
2023-02-08 16:07   ` Vlastimil Babka
2023-02-09  2:02   ` Yajun Deng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230203142324.e5c0652990676ac69a4e5eb1@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Acked-by@kvack.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=vbabka@suse.cz \
    --cc=yajun.deng@linux.dev \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox