]> git.baikalelectronics.ru Git - kernel.git/commit
s390/mm: fix zone calculation in arch_add_memory()
authorGerald Schaefer <gerald.schaefer@de.ibm.com>
Tue, 18 Oct 2016 15:32:18 +0000 (17:32 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 24 Oct 2016 08:26:17 +0000 (10:26 +0200)
commita33d7662be8ffe24682cc14b8fbe7f3fb5fbe075
treea9735a2cb0d695fda2e79532519d21e6629e0b7e
parent92d19e32c184a1814591ed37bb13529bbc60abdb
s390/mm: fix zone calculation in arch_add_memory()

Standby (hotplug) memory should be added to ZONE_MOVABLE on s390. After
commit a65cb386 "s390/mm: make arch_add_memory() NUMA aware",
arch_add_memory() used memblock_end_of_DRAM() to find out the end of
ZONE_NORMAL and the beginning of ZONE_MOVABLE. However, commit 4bde8f08
"memory-hotplug: add hot-added memory ranges to memblock before allocate
node_data for a node." moved the call of memblock_add_node() before
the call of arch_add_memory() in add_memory_resource(), and thus changed
the return value of memblock_end_of_DRAM() when called in
arch_add_memory(). As a result, arch_add_memory() will think that all
memory blocks should be added to ZONE_NORMAL.

Fix this by changing the logic in arch_add_memory() so that it will
manually iterate over all zones of a given node to find out which zone
a memory block should be added to.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/init.c