* + mm-page_alloc-add-missing-hooks-to-bulk-allocation-path.patch added to mm-new branch
@ 2026-09-11 0:01 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-09-11 0:01 UTC (permalink / raw)
To: mm-commits, ziy, vbabka, surenb, mhocko, hannes, gourry,
brendan.jackman, liuqiqi, akpm
The patch titled
Subject: mm: page_alloc: add missing hooks to bulk allocation path
has been added to the -mm mm-new branch. Its filename is
mm-page_alloc-add-missing-hooks-to-bulk-allocation-path.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-add-missing-hooks-to-bulk-allocation-path.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: Qiqi Liu <liuqiqi@kylinos.cn>
Subject: mm: page_alloc: add missing hooks to bulk allocation path
Date: Tue, 8 Sep 2026 18:23:56 +0800
The bulk allocation path in alloc_pages_bulk_noprof() currently misses
trace_mm_page_alloc() and kmsan_alloc_page() calls, leaving bulk-allocated
pages invisible to ftrace/BPF/perf and leaving KMSAN shadow memory stale.
Add both calls in the bulk loop to match the standard allocation path,
placing them before set_page_refcounted() for consistency. The gfp mask
passed to kmsan_alloc_page() is stripped of __GFP_RECLAIM because the bulk
loop runs under the PCP spinlock, and KMSAN's stack depot allocation must
not sleep.
Both are no-ops when their respective features are disabled, so there
is no overhead in production kernels.
Link: https://lore.kernel.org/20260908102356.344075-1-liuqiqi@kylinos.cn
Signed-off-by: Qiqi Liu <liuqiqi@kylinos.cn>
Suggested-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Reviewed-by: Gregory Price (Meta) <gourry@gourry.net>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/page_alloc.c | 2 ++
1 file changed, 2 insertions(+)
--- a/mm/page_alloc.c~mm-page_alloc-add-missing-hooks-to-bulk-allocation-path
+++ a/mm/page_alloc.c
@@ -5273,6 +5273,8 @@ retry_this_zone:
nr_account++;
prep_new_page(page, 0, gfp, ALLOC_DEFAULT);
+ trace_mm_page_alloc(page, 0, gfp, ac.migratetype);
+ kmsan_alloc_page(page, 0, gfp & ~__GFP_RECLAIM);
set_page_refcounted(page);
page_array[nr_populated++] = page;
}
_
Patches currently in -mm which might be from liuqiqi@kylinos.cn are
mm-page_alloc-add-missing-hooks-to-bulk-allocation-path.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 0:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 0:01 + mm-page_alloc-add-missing-hooks-to-bulk-allocation-path.patch added to mm-new branch Andrew Morton
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.