From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,ziy@nvidia.com,willy@infradead.org,
vbabka@kernel.org,usama.arif@linux.dev,surenb@google.com,
shakeel.butt@linux.dev,ryan.roberts@arm.com,roman.gushchin@linux.dev,
nico.pache@linux.dev,muchun.song@linux.dev,mhocko@kernel.org,
liam@infradead.org,lance.yang@linux.dev,kas@kernel.org,hannes@cmpxchg.org,
escape@deepseek.com,dev.jain@arm.com,david@kernel.org,
brendan.jackman@linux.dev,baolin.wang@linux.alibaba.com,baohua@kernel.org,
daejun7.park@samsung.com,akpm@linux-foundation.org
Subject: + mm-page_owner-also-check-pagetail-before-reading-memcg_data.patch added to mm-new branch
Date: Mon, 30 Nov 2026 21:25:17 -0800 [thread overview]
Message-ID: <20261201052518.4C2CA1F000C1@smtp.kernel.org> (raw)
In-Reply-To: <20261104-kpagecgroup-split-v1-2-f70e947fec85@samsung.com>
The patch titled
Subject: mm/page_owner: also check PageTail before reading memcg_data
has been added to the -mm mm-new branch. Its filename is
mm-page_owner-also-check-pagetail-before-reading-memcg_data.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_owner-also-check-pagetail-before-reading-memcg_data.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Daejun Park <daejun7.park@samsung.com>
Subject: mm/page_owner: also check PageTail before reading memcg_data
Date: Wed, 04 Nov 2026 18:59:09 +0900
print_page_owner_memcg() loads memcg_data before it tests PageTail(). In
the first tail page, memcg_data holds the folio's _nr_pages. A split can
make the page a folio between the two loads. The stale _nr_pages then
passes the PageTail() test and is used as an objcg pointer.
__split_folio_to_order() stores memcg_data before the smp_wmb() that
precedes clear_compound_head(). Also test PageTail() before the load,
with a paired smp_rmb(). Keep the test after the load for a page that
becomes a tail in between.
Link: https://patch.msgid.link/20261104-kpagecgroup-split-v1-2-f70e947fec85@samsung.com
Fixes: 4996fc547f5b ("mm: let _folio_nr_pages overlay memcg_data in first tail page")
Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Tao Yi <escape@deepseek.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Nico Pache <nico.pache@linux.dev>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Kiryl Shutsemau <kas@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
mm/page_owner.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/mm/page_owner.c~mm-page_owner-also-check-pagetail-before-reading-memcg_data
+++ a/mm/page_owner.c
@@ -564,6 +564,13 @@ static inline int print_page_owner_memcg
char name[80];
rcu_read_lock();
+ if (PageTail(page))
+ goto out_unlock;
+ /*
+ * Order the memcg_data load after the PageTail() load. Pairs with
+ * smp_wmb() in __split_folio_to_order().
+ */
+ smp_rmb();
memcg_data = READ_ONCE(page->memcg_data);
if (!memcg_data || PageTail(page))
goto out_unlock;
_
Patches currently in -mm which might be from daejun7.park@samsung.com are
mm-huge_memory-set-memcg_data-before-a-split-page-leaves-the-folio.patch
mm-page_owner-also-check-pagetail-before-reading-memcg_data.patch
next prev parent reply other threads:[~2026-12-01 5:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 9:59 [PATCH 0/2] mm: fix memcg_data reads during a THP split Daejun Park via B4 Relay
2026-11-04 9:59 ` Daejun Park
2026-11-04 9:59 ` [PATCH 1/2] mm/huge_memory: set memcg_data before a split page leaves the folio Daejun Park via B4 Relay
2026-11-04 9:59 ` Daejun Park
2026-11-04 16:33 ` Zi Yan
2026-11-05 1:06 ` Daejun Park
2026-12-01 5:24 ` Andrew Morton
2026-12-01 5:25 ` + mm-huge_memory-set-memcg_data-before-a-split-page-leaves-the-folio-fix.patch added to mm-new branch Andrew Morton
2026-12-01 15:07 ` Zi Yan
2026-12-01 5:25 ` + mm-huge_memory-set-memcg_data-before-a-split-page-leaves-the-folio.patch " Andrew Morton
2026-12-01 10:38 ` David Hildenbrand (Arm)
2026-12-01 18:03 ` [PATCH 1/2] mm/huge_memory: set memcg_data before a split page leaves the folio David Hildenbrand (Arm)
2026-11-04 9:59 ` [PATCH 2/2] mm/page_owner: also check PageTail before reading memcg_data Daejun Park via B4 Relay
2026-11-04 9:59 ` Daejun Park
2026-11-04 16:38 ` Zi Yan
2026-12-01 5:25 ` Andrew Morton [this message]
2026-11-06 8:57 ` [PATCH 0/2] mm: fix memcg_data reads during a THP split Tao Yi
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=20261201052518.4C2CA1F000C1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=brendan.jackman@linux.dev \
--cc=daejun7.park@samsung.com \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=escape@deepseek.com \
--cc=hannes@cmpxchg.org \
--cc=kas@kernel.org \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=mhocko@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=muchun.song@linux.dev \
--cc=nico.pache@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=ryan.roberts@arm.com \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=willy@infradead.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.