linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Wenchao Hao <haowenchao22@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/compaction: do not break pages whose order is larger than target order
Date: Fri, 25 Apr 2025 14:53:27 +0800	[thread overview]
Message-ID: <8905cbf7-7507-44de-8721-b3e75e80732b@linux.alibaba.com> (raw)
In-Reply-To: <20250424153815.4003-1-haowenchao22@gmail.com>



On 2025/4/24 23:38, Wenchao Hao wrote:
> When scanning free pages for memory compaction, if the compaction target
> order is explicitly specified, do not split pages in buddy whose order
> are larger than compaction target order.

We've already checked this in suitable_migration_target(), so how did 
you observe that there are still attempts to isolate such non-suitable 
free large folios? Please explain your usecase in detail.

> Signed-off-by: Wenchao Hao <haowenchao22@gmail.com>
> ---
>   mm/compaction.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 3925cb61dbb8..b0ed0831c400 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -656,6 +656,17 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
>   
>   		/* Found a free page, will break it into order-0 pages */
>   		order = buddy_order(page);
> +
> +		/*
> +		 * Do not break free pages whose order is larger than
> +		 * compact's desired order
> +		 */
> +		if (cc->order != -1 && order >= cc->order) {
> +			blockpfn += (1 << order) - 1;
> +			page += (1 << order) - 1;
> +			goto isolate_fail;
> +		}
> +
>   		isolated = __isolate_free_page(page, order);
>   		if (!isolated)
>   			break;


  parent reply	other threads:[~2025-04-25  6:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 15:38 Wenchao Hao
2025-04-24 19:42 ` Johannes Weiner
2025-04-25 14:28   ` Wenchao Hao
2025-04-25 15:32     ` Johannes Weiner
2025-04-25 17:24       ` Wenchao Hao
2025-04-29 16:44   ` Zi Yan
2025-04-25  6:53 ` Baolin Wang [this message]
2025-04-25 14:57   ` Wenchao Hao

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=8905cbf7-7507-44de-8721-b3e75e80732b@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=haowenchao22@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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