]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
commit4a65429457a5d271dd3b00598b3ec75fe8b5103c
treea9735a2cb0d695fda2e79532519d21e6629e0b7e
parent47ece7fef4e4206cdcee7c28ac3bca3ede0a1908
s390/mm: fix zone calculation in arch_add_memory()

Standby (hotplug) memory should be added to ZONE_MOVABLE on s390. After
commit 199071f1 "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 7f36e3e5
"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