From: Kiryl Shutsemau <kas@kernel.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
David Hildenbrand <david@kernel.org>,
Harry Yoo <harry@kernel.org>, Usama Arif <usama.arif@linux.dev>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <brendan.jackman@linux.dev>,
Zi Yan <ziy@nvidia.com>, Shakeel Butt <shakeel.butt@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v3] mm: page_alloc: make defrag_mode retries follow the promoted order
Date: Thu, 15 Oct 2026 13:50:55 +0100 [thread overview]
Message-ID: <atDL-nSFP2KVU7cI@thinkstation> (raw)
In-Reply-To: <20261014202936.GC371161@cmpxchg.org>
On Wed, Oct 14, 2026 at 10:29:36PM +0200, Johannes Weiner wrote:
> On Tue, Oct 13, 2026 at 06:37:20PM +0100, Kiryl Shutsemau wrote:
> > @@ -4127,6 +4127,12 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
> > return page;
> > }
> >
> > +static inline bool order_nofrag_promoted(unsigned int order,
> > + const struct alloc_context *ac)
> > +{
> > + return ac->reclaim_compact_order != order;
> > +}
>
> order_defrag_promoted?
Works for me.
Andrew, could you fold the fixup below?
---
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c593913a14f8..440e515be50b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4127,7 +4127,7 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
return page;
}
-static inline bool order_nofrag_promoted(unsigned int order,
+static inline bool order_defrag_promoted(unsigned int order,
const struct alloc_context *ac)
{
return ac->reclaim_compact_order != order;
@@ -4260,7 +4260,7 @@ should_compact_retry(gfp_t gfp_mask, struct alloc_context *ac, int order,
* Promoted requests fall back instead.
*/
if (compact_result == COMPACT_SKIPPED) {
- if (!order_nofrag_promoted(order, ac))
+ if (!order_defrag_promoted(order, ac))
ret = compaction_zonelist_suitable(ac, order,
alloc_flags, gfp_mask);
goto out;
@@ -4642,7 +4642,7 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
* for compaction without freeing anything.
*/
if (did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER &&
- !order_nofrag_promoted(order, ac))
+ !order_defrag_promoted(order, ac))
*no_progress_loops = 0;
else
(*no_progress_loops)++;
@@ -5024,7 +5024,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
if (defrag_mode && (alloc_flags & ALLOC_NOFRAGMENT)) {
alloc_flags &= ~ALLOC_NOFRAGMENT;
/* Retries went into making blocks, start the fallback afresh */
- if (order_nofrag_promoted(order, ac)) {
+ if (order_defrag_promoted(order, ac)) {
no_progress_loops = 0;
compaction_retries = 0;
}
--
Kiryl Shutsemau / Kirill A. Shutemov
prev parent reply other threads:[~2026-10-15 12:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 12:55 [PATCH v3] mm: page_alloc: make defrag_mode retries follow the promoted order Kiryl Shutsemau (Meta)
2026-10-09 14:05 ` Usama Arif
2026-10-10 22:49 ` Andrew Morton
2026-10-12 10:17 ` Kiryl Shutsemau
2026-10-12 11:40 ` Vlastimil Babka (SUSE)
2026-10-13 2:28 ` Andrew Morton
2026-10-13 17:37 ` Kiryl Shutsemau
2026-10-13 18:15 ` Vlastimil Babka (SUSE)
2026-10-14 20:29 ` Johannes Weiner
2026-10-15 7:16 ` Vlastimil Babka (SUSE)
2026-10-15 12:55 ` Kiryl Shutsemau
2026-10-15 13:53 ` Vlastimil Babka (SUSE)
2026-10-15 14:39 ` Kiryl Shutsemau
2026-10-15 12:50 ` Kiryl Shutsemau [this message]
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=atDL-nSFP2KVU7cI@thinkstation \
--to=kas@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brendan.jackman@linux.dev \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=harry@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.kernel.org \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--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