[PATCH v1 00/11] Zero page->private when freeing pages

Zi Yan ziy at nvidia.com
Mon Feb 23 14:26:30 AEDT 2026


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.

People are only cc'd on the cover letter and related patches.
Mailing lists get all patches.

Patch 1 to 9: fix all users do not zero ->private upon freeing pages.
I only tested part of them, so would like to get reviews to make sure I
did the right thing.

Patch 10    : restores page->private check in folio split code, since
the code was removed in a prior commit without a proper reason.

Patch 11    : adds checks in page freeing path, __free_pages_prepare(),
to make sure freed pages have zeroed ->prviate.

Any comment or suggestion is welcome.

Thanks.


Link: https://lore.kernel.org/all/91F2E741-5473-4D34-ADA1-C9E6EDCBF5E0@nvidia.com/ [1]


# MM - THP
Cc: David Hildenbrand <david at kernel.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes at oracle.com>
Cc: Baolin Wang <baolin.wang at linux.alibaba.com>
Cc: "Liam R. Howlett" <Liam.Howlett at oracle.com>
Cc: Nico Pache <npache at redhat.com>
Cc: Ryan Roberts <ryan.roberts at arm.com>
Cc: Dev Jain <dev.jain at arm.com>
Cc: Barry Song <baohua at kernel.org>
Cc: Lance Yang <lance.yang at linux.dev>

# MM - page allocator
Cc: Suren Baghdasaryan <surenb at google.com>
Cc: Michal Hocko <mhocko at suse.com>
Cc: Brendan Jackman <jackmanb at google.com>
Cc: Johannes Weiner <hannes at cmpxchg.org>

# relay
Cc: Jason Xing <kernelxing at tencent.com>
Cc: Yushan Zhou <katrinzhou at tencent.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat at kernel.org>

# MM - slub
Cc: Vlastimil Babka <vbabka at kernel.org>
Cc: Christoph Lameter <cl at gentwo.org>
Cc: David Rientjes <rientjes at google.com>
Cc: Roman Gushchin <roman.gushchin at linux.dev>
Cc: Harry Yoo <harry.yoo at oracle.com>

# DRM TTM
Cc: Christian Koenig <christian.koenig at amd.com>
Cc: Huang Rui <ray.huang at amd.com>
Cc: Matthew Auld <matthew.auld at intel.com>
Cc: Matthew Brost <matthew.brost at intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Maxime Ripard <mripard at kernel.org>
Cc: Thomas Zimmermann <tzimmermann at suse.de>
Cc: David Airlie <airlied at gmail.com>
Cc: Simona Vetter <simona at ffwll.ch>

# Block
Cc: Jens Axboe <axboe at kernel.dk>

# watch queue
Cc: Christian Brauner <brauner at kernel.org>
Cc: K Prateek Nayak <kprateek.nayak at amd.com>
Cc: Davidlohr Bueso <dave at stgolabs.net>
Cc: Eric Sandeen <sandeen at redhat.com>

# binder
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Cc: "Arve Hjønnevåg" <arve at android.com>
Cc: Todd Kjos <tkjos at android.com>
Cc: Christian Brauner <brauner at kernel.org>
Cc: Carlos Llamas <cmllamas at google.com>
Cc: Alice Ryhl <aliceryhl at google.com>

# null_blk
Cc: Damien Le Moal <dlemoal at kernel.org>
Cc: Johannes Thumshirn <johannes.thumshirn at wdc.com>

# percpu
Cc: Dennis Zhou <dennis at kernel.org>
Cc: Tejun Heo <tj at kernel.org>
Cc: Christoph Lameter <cl at gentwo.org>

# erofs
Cc: Gao Xiang <xiang at kernel.org>
Cc: Yue Hu <zbestahu at gmail.com>
Cc: Jeffle Xu <jefflexu at linux.alibaba.com>
Cc: Sandeep Dhavale <dhavale at google.com>
Cc: Hongbo Li <lihongbo22 at huawei.com>
Cc: Chunhai Guo <guochunhai at vivo.com>

# lists
Cc: linux-erofs at lists.ozlabs.org
Cc: linux-block at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: linux-mm at kvack.org
Cc: linux-kernel at vger.kernel.org

Zi Yan (11):
  relay: zero page->private when freeing pages
  mm/slub: zero page->private when freeing pages
  drm/ttm: zero page->private when freeing pages
  blk-mq: zero page->private when freeing pages
  watch_queue: zero page->private when freeing pages
  binder: zero page->private when freeing pages
  null_blk: zero page->private when freeing pages
  percpu: zero page->private when freeing pages
  erofs: zero page->private when freeing pages
  mm/huge_memory: add page->private check back in
    __split_folio_to_order()
  mm/page_alloc: check page->private upon page free

 block/blk-mq-tag.c             |  6 +++++-
 drivers/android/binder_alloc.c |  1 +
 drivers/block/null_blk/main.c  |  1 +
 drivers/gpu/drm/ttm/ttm_pool.c |  1 +
 fs/erofs/zutil.c               |  1 +
 kernel/relay.c                 |  8 ++++++--
 kernel/watch_queue.c           |  8 ++++++--
 mm/huge_memory.c               | 10 ++++++++++
 mm/page_alloc.c                |  3 ++-
 mm/percpu-vm.c                 |  4 +++-
 mm/slub.c                      |  1 +
 11 files changed, 37 insertions(+), 7 deletions(-)

-- 
2.51.0



More information about the Linux-erofs mailing list