Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zi Yan" <ziy@nvidia.com>
To: "Lance Yang" <lance.yang@linux.dev>, <david@kernel.org>
Cc: <akpm@linux-foundation.org>, <vbabka@kernel.org>,
	<surenb@google.com>, <mhocko@suse.com>, <jackmanb@google.com>,
	<hannes@cmpxchg.org>, <ljs@kernel.org>,
	<baolin.wang@linux.alibaba.com>, <liam@infradead.org>,
	<npache@redhat.com>, <ryan.roberts@arm.com>, <dev.jain@arm.com>,
	<baohua@kernel.org>, <rppt@kernel.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] mm/page_alloc: remove set_page_private() in prep_compound_tail()
Date: Wed, 01 Jul 2026 09:33:07 -0400	[thread overview]
Message-ID: <DJN9U3JV5OPY.3HVOJNXOAYOO1@nvidia.com> (raw)
In-Reply-To: <20260701122506.77115-1-lance.yang@linux.dev>

On Wed Jul 1, 2026 at 8:25 AM EDT, Lance Yang wrote:
>
> On Wed, Jul 01, 2026 at 10:58:21AM +0200, David Hildenbrand (Arm) wrote:
>>On 6/29/26 04:56, Zi Yan wrote:
>>> With the subpage->private == 0 check added in a prior commit, any allocated
>>> compound page should not have nonzero subpage->private. Remove the
>
> With Vlastimil's suggestion on patch #03, we still expect tail pages to
> have 0 ->private when freed, but only check it when check_pages_enabled
> is enabled :)
>
>>> unnecessary subpage->private initialization code in compound page
>>> preparation.
>>> 
>>> Signed-off-by: Zi Yan <ziy@nvidia.com>
>>> ---
>>>  mm/internal.h | 1 -
>>>  1 file changed, 1 deletion(-)
>>> 
>>> diff --git a/mm/internal.h b/mm/internal.h
>>> index 181e79f1d6a2..c96421ce9350 100644
>>> --- a/mm/internal.h
>>> +++ b/mm/internal.h
>>> @@ -895,7 +895,6 @@ static inline void prep_compound_tail(struct page *tail,
>>>  {
>>>  	tail->mapping = TAIL_MAPPING;
>>>  	set_compound_head(tail, head, order);
>>> -	set_page_private(tail, 0);
>>
>>Do we want another safety check, maybe another VM_WARN_ON_ONCE?
>
> Right! I think such a check might still be useful. Same old footgun :P
>
> Cheers, Lance

Sure. Will add a VM_WARN_ON_ONCE(tail->private).



-- 
Best Regards,
Yan, Zi



      reply	other threads:[~2026-07-01 13:33 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)
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 [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=DJN9U3JV5OPY.3HVOJNXOAYOO1@nvidia.com \
    --to=ziy@nvidia.com \
    --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=vbabka@kernel.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