diff options
| author | David Hildenbrand <[email protected]> | 2020-08-06 23:17:13 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2020-08-07 11:33:21 -0700 |
| commit | 4a93025cbe4a0b19d1a25a2d763a3d2018bad0d9 (patch) | |
| tree | e08da493454ea2f7728adebca493a9a4cc4b4e88 /scripts/const_structs.checkpatch | |
| parent | c1a06df6ebf6ca98fb7a672fe447c7469d6c1968 (diff) | |
mm/shuffle: don't move pages between zones and don't read garbage memmaps
Especially with memory hotplug, we can have offline sections (with a
garbage memmap) and overlapping zones. We have to make sure to only touch
initialized memmaps (online sections managed by the buddy) and that the
zone matches, to not move pages between zones.
To test if this can actually happen, I added a simple
BUG_ON(page_zone(page_i) != page_zone(page_j));
right before the swap. When hotplugging a 256M DIMM to a 4G x86-64 VM and
onlining the first memory block "online_movable" and the second memory
block "online_kernel", it will trigger the BUG, as both zones (NORMAL and
MOVABLE) overlap.
This might result in all kinds of weird situations (e.g., double
allocations, list corruptions, unmovable allocations ending up in the
movable zone).
Fixes: e900a918b098 ("mm: shuffle initial free memory to improve memory-side-cache utilization")
Signed-off-by: David Hildenbrand <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Wei Yang <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Dan Williams <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Huang Ying <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: <[email protected]> [5.2+]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions