summaryrefslogtreecommitdiff
path: root/include/linux/pgalloc.h
diff options
context:
space:
mode:
authorBrendan Jackman <jackmanb@google.com>2026-05-19 17:17:58 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-06-03 01:22:20 +0300
commit47166f2199557e57cbab2882b033fb2949818fbb (patch)
tree25834b13a194b26da0317d691252630edc7d1416 /include/linux/pgalloc.h
parentd231522bf07287c5bcf7c6af6960f476663324b5 (diff)
downloadlinux-47166f2199557e57cbab2882b033fb2949818fbb.tar.xz
mm/page_alloc: document that alloc_pages_nolock() uses RCU
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>
Diffstat (limited to 'include/linux/pgalloc.h')
0 files changed, 0 insertions, 0 deletions