OSDN Git Service

s390/mm: Fix memory hotplug for unaligned standby memory
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Wed, 1 Apr 2015 16:49:11 +0000 (18:49 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 15 Apr 2015 10:23:49 +0000 (12:23 +0200)
commit8741ce6d114873e482b1ef298d6537d18ff393d3
tree1841f0865c446b72cc530a53900b31676b309538
parent054623105728b06852f077299e2bf1bf3d5f2b0b
s390/mm: Fix memory hotplug for unaligned standby memory

Commit 27356f54c8c3 ("mm/hotplug: verify hotplug memory range")
introduced a check that makes add_memory() only accept section size
aligned memory.

Therefore on z/VM systems, where standby memory is not aligned, no
standby memory is registered at all.

Example:

 #cp def store 3504M standby 2336M
 00: CP Q V STORE
 00: STORAGE = 3504M MAX = 6G INC = 8M STANDBY = 2336M RESERVED = 0

For this setup the following error message is printed:

 Section-unaligned hotplug range: start 0xdb000000, size 0x92000000

So fix this and register aligned memory in "sclp_cmd.c". This means
that for the corner cases where the standby memory is not aligned we
loose some memory.

In order to inform the user about the potential loss of standby memory,
we add a new message for each added standby block and print how
much of the standby memory is usable, for example:

 sclp_cmd.4336b4: Standby memory at 0x50000000 (256M of 256M usable)
 sclp_cmd.4336b4: Standby memory at 0xb0000000 (256M of 256M usable)
 sclp_cmd.4336b4: Standby memory at 0xdb000000 (2048M of 2336M usable)

We also ensure that a potential memory block that contains both "assigned"
and "standby" memory cannot be setup offline.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/sclp_cmd.c