From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Zi Yan <ziy@nvidia.com>,
Andrew Morton <akpm@linux-foundation.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
Brendan Jackman <jackmanb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
David Hildenbrand <david@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <liam@infradead.org>,
Nico Pache <npache@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
Mike Rapoport <rppt@kernel.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] mm/compaction: stop recording free page order in page->private
Date: Mon, 29 Jun 2026 16:28:30 +0200 [thread overview]
Message-ID: <220774cb-ba5b-4a12-a649-955c83bfc704@kernel.org> (raw)
In-Reply-To: <20260628-keep-subpage-private-zero-at-free-v1-1-f4ce3930d10f@nvidia.com>
On 6/29/26 04:56, Zi Yan wrote:
> Commit 733aea0b3a7bb ("mm/compaction: add support for >0 order folio
> memory compaction.") stores isolated free pages in an array indexed by free
> page orders, it is no longer needed to store the order in each page's
> ->private field. And there is no code using the stored order. Stop doing
> that.
Ah, great observation. Cool.
> It also prepares for an upcoming change that ensures subpage->private is
> zero at page free time and the removal of set_page_private(0) from
> prep_compound_tail(). In alloc_contig_frozen_range_noprof(),
> isolate_freepages_range() is used to grab free pages from buddy allocator
> and it leaves the aforementioned page->private set until
> either split_free_frozen_pages() or prep_new_page() is called. That
> triggers the upcoming subpage->private nonzero check along once
> set_page_private(0) is removed from prep_compound_tail(), which is called
> via prep_new_page().
I'm not sure it needs to be said here (or in such detail?)
> Signed-off-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
> ---
> mm/compaction.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index b776f35ad020..349838cc6c19 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -644,7 +644,6 @@ static unsigned long isolate_freepages_block(struct compact_control *cc,
> isolated = __isolate_free_page(page, order);
> if (!isolated)
> break;
> - set_page_private(page, order);
>
> nr_scanned += isolated - 1;
> total_isolated += isolated;
> @@ -1617,7 +1616,6 @@ static void fast_isolate_freepages(struct compact_control *cc)
> /* Isolate the page if available */
> if (page) {
> if (__isolate_free_page(page, order)) {
> - set_page_private(page, order);
> nr_isolated = 1 << order;
> nr_scanned += nr_isolated - 1;
> total_isolated += nr_isolated;
> @@ -1846,7 +1844,6 @@ static struct folio *compaction_alloc_noprof(struct folio *src, unsigned long da
> size >>= 1;
>
> list_add(&freepage[size].lru, &cc->freepages[start_order]);
> - set_page_private(&freepage[size], start_order);
> }
> dst = (struct folio *)freepage;
>
>
next prev parent reply other threads:[~2026-06-29 14:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 2:56 [PATCH 0/4] Keep subpage private zero at free and folio split time Zi Yan
2026-06-29 2:56 ` [PATCH 1/4] mm/compaction: stop recording free page order in page->private Zi Yan
2026-06-29 14:28 ` Vlastimil Babka (SUSE) [this message]
2026-06-29 15:03 ` Zi Yan
2026-06-30 1:32 ` Baolin Wang
2026-06-30 1:37 ` Zi Yan
2026-06-29 2:56 ` [PATCH 2/4] mm/huge_memory: add page->private check back in __split_folio_to_order() Zi Yan
2026-06-29 14:39 ` Vlastimil Babka (SUSE)
2026-06-29 15:05 ` Zi Yan
2026-06-29 2:56 ` [PATCH 3/4] mm/page_alloc: make sure subpage->private is zero at page free time Zi Yan
2026-06-29 14:53 ` Vlastimil Babka (SUSE)
2026-06-29 15:07 ` Zi Yan
2026-06-29 2:56 ` [PATCH 4/4] mm/page_alloc: remove set_page_private() in prep_compound_tail() Zi Yan
2026-06-29 15:45 ` Vlastimil Babka (SUSE)
2026-06-29 16:50 ` Zi Yan
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=220774cb-ba5b-4a12-a649-955c83bfc704@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=npache@redhat.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--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