linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Hao <haowenchao22@gmail.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: 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: Sat, 26 Apr 2025 01:24:14 +0800	[thread overview]
Message-ID: <CAOptpSNX9adqgJpjz3WP9G8xoQHNF+7OHe+WYD1gDHhp9WFZng@mail.gmail.com> (raw)
In-Reply-To: <20250425153232.GA108388@cmpxchg.org>

On Fri, Apr 25, 2025 at 11:32 PM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> On Fri, Apr 25, 2025 at 10:28:42PM +0800, Wenchao Hao wrote:
> > On Fri, Apr 25, 2025 at 3:42 AM Johannes Weiner <hannes@cmpxchg.org> wrote:
> > >
> > > On Thu, Apr 24, 2025 at 11:38:15PM +0800, 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.
> > >
> > > Have you observed this to be an issue in practice?
> > >
> > > compact_finished() would have bailed if such a page had existed.
> > >
> >
> > Yes, when proactive memory compaction is enabled, there may be situations
> > where the order of isolated free pages is greater than the compaction
> > requested order, and compact_finished() will return continue.
>
> proactive compaction has an order of -1?

The order in struct compact_control is not directly related to
proactive compaction.

I just added a check here, if the compaction is awakened by wakeup_kcompactd()
and the target order of compaction is set, the free folios larger than
the target order
will not be split when isolating the free pages.

The following scenarios will appear when there are free pages larger
than the target
order of compaction but compact_finished() will return continue:

1. proactive compaction is enabled, kcompactd is awakened for compaction
2. the defrag_mode you added, __compact_finished() will return continue if
     the number of pageblocks size folios is smaller than watermark


  reply	other threads:[~2025-04-25 17:24 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 [this message]
2025-04-29 16:44   ` Zi Yan
2025-04-25  6:53 ` Baolin Wang
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=CAOptpSNX9adqgJpjz3WP9G8xoQHNF+7OHe+WYD1gDHhp9WFZng@mail.gmail.com \
    --to=haowenchao22@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --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