From: "Christian König" <christian.koenig@amd.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
Christoph Hellwig <hch@infradead.org>, Zi Yan <ziy@nvidia.com>
Cc: linux-mm@kvack.org, "Andrew Morton" <akpm@linux-foundation.org>,
linux-erofs@lists.ozlabs.org, linux-block@vger.kernel.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
"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>,
"Suren Baghdasaryan" <surenb@google.com>,
"Michal Hocko" <mhocko@suse.com>,
"Brendan Jackman" <jackmanb@google.com>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Jason Xing" <kernelxing@tencent.com>,
"Yushan Zhou" <katrinzhou@tencent.com>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
"Vlastimil Babka" <vbabka@kernel.org>,
"Christoph Lameter" <cl@gentwo.org>,
"David Rientjes" <rientjes@google.com>,
"Roman Gushchin" <roman.gushchin@linux.dev>,
"Harry Yoo" <harry.yoo@oracle.com>,
"Huang Rui" <ray.huang@amd.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>, "Jens Axboe" <axboe@kernel.dk>,
"Christian Brauner" <brauner@kernel.org>,
"K Prateek Nayak" <kprateek.nayak@amd.com>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"Eric Sandeen" <sandeen@redhat.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Carlos Llamas" <cmllamas@google.com>,
"Alice Ryhl" <aliceryhl@google.com>,
"Damien Le Moal" <dlemoal@kernel.org>,
"Johannes Thumshirn" <johannes.thumshirn@wdc.com>,
"Dennis Zhou" <dennis@kernel.org>, "Tejun Heo" <tj@kernel.org>,
"Gao Xiang" <xiang@kernel.org>, "Yue Hu" <zbestahu@gmail.com>,
"Jeffle Xu" <jefflexu@linux.alibaba.com>,
"Sandeep Dhavale" <dhavale@google.com>,
"Hongbo Li" <lihongbo22@huawei.com>,
"Chunhai Guo" <guochunhai@vivo.com>
Subject: Re: [PATCH v1 00/11] Zero page->private when freeing pages
Date: Mon, 23 Feb 2026 16:22:17 +0100 [thread overview]
Message-ID: <da2f5f7c-0252-4085-a490-a505d0169bc4@amd.com> (raw)
In-Reply-To: <5105764a-8313-45bd-8b91-8c0ea8cdf077@kernel.org>
On 2/23/26 15:14, David Hildenbrand (Arm) wrote:
> On 2/23/26 15:06, Christian König wrote:
>> On 2/23/26 14:46, Christoph Hellwig wrote:
>>> On Sun, Feb 22, 2026 at 10:26:30PM -0500, Zi Yan wrote:
>>>> Hi all,
>>>>
>>>> Based on a recent discussion with David Hildenbrand on page->private
>>>> is not zero when a page is freed[1], this patchset is trying to fix all
>>>> users do not zero ->private when freeing a page and add checks to make
>>>> sure all freed pages have ->private set to zero. For compound pages,
>>>> both head page and tail pages need to have ->private set to zero.
>>>
>>> Requiring the user to clear a field before freeing is just a way to
>>> awkward interface. Don't do that.
>>
>> Completely agree. This is just asking for trouble.
>>
>> The cache line(s) backing this struct page are most likely accessed anyway on free/alloc. So I don't see much extra overhead.
>
> I think the question is more around handling non-head pages when freeing larger orders. But maybe the overhead of zeroing page->private it there as well in __free_pages_prepare() is tolerable.
Good point, sounds like that is a bit more than I thought it would be.
> I'll note, though, that we already require page->mapping and page->memcg_data of pages to be zeroed by the caller, so it's not completely crazy. (see page_expected_state)
Well that's not defensive at all, basically everybody which forgets to do that can cause hard to debug trouble. Maybe that practice should be reconsidered.
Regards,
Christian.
next prev parent reply other threads:[~2026-02-23 15:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 3:26 Zi Yan
2026-02-23 3:26 ` [PATCH v1 01/11] relay: zero " Zi Yan
2026-02-23 14:45 ` Usama Arif
2026-02-23 3:26 ` [PATCH v1 02/11] mm/slub: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 03/11] drm/ttm: " Zi Yan
2026-02-23 10:43 ` Christian König
2026-02-23 3:26 ` [PATCH v1 04/11] blk-mq: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 05/11] watch_queue: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 06/11] binder: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 07/11] null_blk: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 08/11] percpu: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 09/11] erofs: " Zi Yan
2026-02-23 3:26 ` [PATCH v1 10/11] mm/huge_memory: add page->private check back in __split_folio_to_order() Zi Yan
2026-02-23 3:26 ` [PATCH v1 11/11] mm/page_alloc: check page->private upon page free Zi Yan
2026-02-23 4:28 ` [PATCH v1 00/11] Zero page->private when freeing pages Matthew Wilcox
2026-02-23 9:36 ` David Hildenbrand (Arm)
2026-02-23 8:40 ` [syzbot ci] " syzbot ci
2026-02-23 13:46 ` [PATCH v1 00/11] " Christoph Hellwig
2026-02-23 14:00 ` Zi Yan
2026-02-23 14:03 ` Christoph Hellwig
2026-02-23 14:11 ` Zi Yan
2026-02-23 14:06 ` Christian König
2026-02-23 14:14 ` David Hildenbrand (Arm)
2026-02-23 15:22 ` Christian König [this message]
2026-02-23 15:27 ` David Hildenbrand (Arm)
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=da2f5f7c-0252-4085-a490-a505d0169bc4@amd.com \
--to=christian.koenig@amd.com \
--cc=Liam.Howlett@oracle.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=axboe@kernel.dk \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=brauner@kernel.org \
--cc=cl@gentwo.org \
--cc=cmllamas@google.com \
--cc=dave@stgolabs.net \
--cc=david@kernel.org \
--cc=dennis@kernel.org \
--cc=dev.jain@arm.com \
--cc=dhavale@google.com \
--cc=dlemoal@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=guochunhai@vivo.com \
--cc=hannes@cmpxchg.org \
--cc=harry.yoo@oracle.com \
--cc=hch@infradead.org \
--cc=jackmanb@google.com \
--cc=jefflexu@linux.alibaba.com \
--cc=johannes.thumshirn@wdc.com \
--cc=katrinzhou@tencent.com \
--cc=kernelxing@tencent.com \
--cc=kprateek.nayak@amd.com \
--cc=lance.yang@linux.dev \
--cc=lihongbo22@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mhiramat@kernel.org \
--cc=mhocko@suse.com \
--cc=mripard@kernel.org \
--cc=npache@redhat.com \
--cc=ray.huang@amd.com \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=sandeen@redhat.com \
--cc=simona@ffwll.ch \
--cc=surenb@google.com \
--cc=tj@kernel.org \
--cc=tkjos@android.com \
--cc=tzimmermann@suse.de \
--cc=vbabka@kernel.org \
--cc=xiang@kernel.org \
--cc=zbestahu@gmail.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