summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-11-03 17:16:50 +0100
committerVlastimil Babka (SUSE) <vbabka@kernel.org>2026-11-10 09:19:09 +0100
commit58e81bb7de5aac8ec5e4aa21d401e7dafbd4058b (patch)
tree787b42f5b25047b3262c9b0595e7d9011cfc892c /include
parent213268869301f747d19ca00a391757a6cf2d4fa8 (diff)
mm/memory_hotplug: resize zones under their seqlock
With CONFIG_DEBUG_VM the page allocator checks that a page which is freed, split or allocated lies within its zone. The check reads zone->zone_start_pfn and zone->spanned_pages under zone->span_seqlock, as memory hotplug can change the two at any time. Commit 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") removed the write side, since all resizing is serialized by the hotplug lock. That leaves the reader without protection. When memory below the start of a zone goes online, the start is lowered first and the size is raised afterwards. When the lowest memory of a zone goes offline, the size is reduced first. In between, the zone seems to end before its last pages. If one of them goes through the allocator at that moment, it is reported as being outside of the zone triggers VM_BUG_ON_PAGE(). Write the two fields in a write section of the seqlock. Interrupts are disabled as pages are freed from interrupts, too, and the reader would wait for the writer which it has interrupted. Fixes: 27cacaad16c5 ("mm,memory_hotplug: drop unneeded locking") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-4-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions