From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
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>,
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 2/4] mm/huge_memory: add page->private check back in __split_folio_to_order()
Date: Wed, 1 Jul 2026 10:56:47 +0200 [thread overview]
Message-ID: <98cf3340-1a2f-4d50-8410-6e9d6d3a5308@kernel.org> (raw)
In-Reply-To: <9fe5173c-4beb-42fe-8f7e-385c609f899f@kernel.org>
On 6/29/26 16:39, Vlastimil Babka (SUSE) wrote:
> On 6/29/26 04:56, Zi Yan wrote:
s/add/readd/
>> page->private should not be set in tail pages. Commit 4265d67e405a
>> ("mm/migrate_device: add THP splitting during migration") removed it
>> without a proper reason. Add it back.
You can link to the discussion where we clarified that this was not intentional.
>>
>> Signed-off-by: Zi Yan <ziy@nvidia.com>
>> ---
>> mm/huge_memory.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
>> index 2bccb0a53a0a..037d67fbec6e 100644
>> --- a/mm/huge_memory.c
>> +++ b/mm/huge_memory.c
>> @@ -3594,6 +3594,16 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
>> new_folio->mapping = folio->mapping;
>> new_folio->index = folio->index + i;
>>
>> + /*
>> + * page->private should not be set in tail pages. Fix up and warn once
>> + * if private is unexpectedly set. Do it before swap.val assignment
>> + * since private overlaps with swap.val.
>> + */
>> + if (unlikely(new_folio->private)) {
>> + VM_WARN_ON_ONCE_PAGE(true, new_head);
>> + new_folio->private = NULL;
>> + }
>
> The unconditional warning means this is not expected to happen. In that case
> it's odd to check and fixup always, but only warn with CONFIG_DEBUG_VM.
>
> If we are reasonably sure the current code is OK, and only want to catch new
> mistakes in development, we could just VM_WARN_ON_ONCE_PAGE() without fixup.
>
> If we are paranoid, leave it as it is, but drop the "VM_" ?
Agreed, either "if (WARN_ON_ONCE(new_folio->private))" + fixup, or no fixup.
I'd prefer VM_WARN_ON_ONCE_PAGE().
(I was only able to trigger this once while testing my own patches)
--
Cheers,
David
next prev parent reply other threads:[~2026-07-01 8:56 UTC|newest]
Thread overview: 24+ 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)
2026-06-29 15:03 ` Zi Yan
2026-06-30 1:32 ` Baolin Wang
2026-06-30 1:37 ` Zi Yan
2026-07-01 8:54 ` David Hildenbrand (Arm)
2026-07-01 6:49 ` Lance Yang
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-07-01 8:56 ` David Hildenbrand (Arm) [this message]
2026-07-01 11:01 ` Lance Yang
2026-07-01 11:08 ` David Hildenbrand (Arm)
2026-07-01 13:32 ` 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
2026-07-01 8:58 ` David Hildenbrand (Arm)
2026-07-01 12:25 ` Lance Yang
2026-07-01 13:33 ` 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=98cf3340-1a2f-4d50-8410-6e9d6d3a5308@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.