* [merged mm-stable] mm-page_alloc-document-that-alloc_pages_nolock-uses-rcu.patch removed from -mm tree
@ 2026-06-02 22:24 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-06-02 22:24 UTC (permalink / raw)
To: mm-commits, ziy, vbabka, surenb, mhocko, junaids, harry, hannes,
ast, jackmanb, akpm
The quilt patch titled
Subject: mm/page_alloc: document that alloc_pages_nolock() uses RCU
has been removed from the -mm tree. Its filename was
mm-page_alloc-document-that-alloc_pages_nolock-uses-rcu.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Brendan Jackman <jackmanb@google.com>
Subject: mm/page_alloc: document that alloc_pages_nolock() uses RCU
Date: Tue, 19 May 2026 14:17:58 +0000
The allocator interacts with cgroups which rely on RCU. RCU does not work
everywhere, so the "any context" claim is slightly overstated here.
This should already be enforced by objtool, since this function is not
marked noinstr the x86 build should fail if you call it from a place where
RCU is not watching. But, expecting readers to make that connection for
themselves seems a bit cruel (I don't think there is even any
documentation of what noinstr means at all, let alone the connection with
RCU).
Note this is not claiming that any cgroup code called from the allocator
would actually break if this restriction was violated, it could very well
be that there's no real way for the allocator to act on a cgroup that can
disappear concurrently. But, since it's likely nobody has verified this
one way or another, better to just be safe and declare that RCU is
required. Allocating from an RCU-unsafe context seems a bit crazy anyway.
Link: https://lore.kernel.org/20260519-nolock-rcu-comment-v1-1-4a630c8794e5@google.com
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Suggested-by: Junaid Shahid <junaids@google.com>
Acked-by: Harry Yoo (Oracle) <harry@kernel.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/page_alloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/page_alloc.c~mm-page_alloc-document-that-alloc_pages_nolock-uses-rcu
+++ a/mm/page_alloc.c
@@ -7937,8 +7937,8 @@ struct page *alloc_frozen_pages_nolock_n
* @order: allocation order size
*
* Allocates pages of a given order from the given node. This is safe to
- * call from any context (from atomic, NMI, and also reentrant
- * allocator -> tracepoint -> alloc_pages_nolock_noprof).
+ * call from any context where RCU is watching (from atomic, NMI, and also
+ * reentrant allocator -> tracepoint -> alloc_pages_nolock_noprof).
* Allocation is best effort and to be expected to fail easily so nobody should
* rely on the success. Failures are not reported via warn_alloc().
* See always fail conditions below.
_
Patches currently in -mm which might be from jackmanb@google.com are
mm-delete-stale-comment-about-cachelines.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-02 22:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 22:24 [merged mm-stable] mm-page_alloc-document-that-alloc_pages_nolock-uses-rcu.patch removed from -mm tree 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.