Skip to contentSkip to conversation

mm: migrate: restore the nmask after successfully allocating on the target node

PATCH Simon Wang (王传国) 1 participant 1 message Apr 1, 2025 Memory management

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines · wangchuanguo
Quoted 7 lines

If memory is successfully allocated on the target node and the function directly returns without value restore for nmask, non-first migration operations in migrate_pages() by again label may ignore the nmask settings, thereby allowing new memory allocations for migration on any node.

Quoted 8 lines

Unless I am missing something this looks reasonable, but I whonder why nobody noticed it before.
It is a path that should be pretty exercised.

--
Oscar Salvador
SUSE Labs

I tested it, and even when the nmask is set to all zeros, memory allocation still occurs on other nodes.
I suspect this is because the bug ​expands the range of eligible nodes for memory allocation instead of causing allocation failures, which is why it has gone unnoticed.