• Michael Holzheu's avatar
    s390/mm: Fix memory hotplug for unaligned standby memory · 8741ce6d
    Michael Holzheu authored
    Commit 27356f54 ("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: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
    Reviewed-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
    Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    8741ce6d
sclp_cmd.c 17 KB