------- Comment From geral...@de.ibm.com 2016-08-30 13:25 EDT-------
This actually "works as designed", and the missing block is not only block 10 
but also block 14. Both blocks contain part of the standby memory, but not 
aligned to the Linux memory block size. Block 10 also contains the crashkernel 
memory, if you try it w/o crashkernel memory (or use a more current kernel, as 
this behaviour was changed) then it should be visible but cannot be set offline.

The reason why you can only use 768 MB of your 1 GB standby memory is
because both the start and end address (in block 10 and 14) are not
aligned to the Linux memory block size of 256 MB, which leaves only 768
MB of usable standby memory (i.e. standby memory that consumes a whole
Linux memory block).

The following commit introduced this "capping" and also a message that
you should find in your dmesg output, unfortunately w/o the kmsg
description because Ubuntu has no kmsg man pages:

commit 8741ce6d114873e482b1ef298d6537d18ff393d3
Author: Michael Holzheu <holz...@linux.vnet.ibm.com>
Date:   Wed Apr 1 18:49:11 2015 +0200

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.schae...@de.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carst...@de.ibm.com>
Signed-off-by: Michael Holzheu <holz...@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidef...@de.ibm.com>

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1618203

Title:
  missing memory slot at /sys/bus/memory/devices when starting memory
  size is not a multiple of block size

Status in Ubuntu on IBM z Systems:
  New
Status in linux package in Ubuntu:
  New

Bug description:
  == Comment: #0 - Ofer Baruch  - 2016-08-28 07:41:53 ==
  When you set the memory size of a Ubuntu Guest to a number which is not a 
multiple of the memory block size (in our case 256MB) there are missing memory 
slots at /sys/bus/memory/devices.

  for example setting memory like this:
  STORAGE = 2704M MAX = 15000M INC = 8M STANDBY = 512M RESERVED = 512M

  will cause memory slot 10 to be missing:
  root@UBU9LT1:/sys/bus/memory/devices# ll
  total 0
  drwxr-xr-x 2 root root 0 Aug 24 09:43 ./
  drwxr-xr-x 4 root root 0 Aug 24 09:43 ../
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory0 -> 
../../../devices/system/memory/memory0/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory1 -> 
../../../devices/system/memory/memory1/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory11 -> 
../../../devices/system/memory/memory11/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory12 -> 
../../../devices/system/memory/memory12/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory13 -> 
../../../devices/system/memory/memory13/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory2 -> 
../../../devices/system/memory/memory2/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory3 -> 
../../../devices/system/memory/memory3/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory4 -> 
../../../devices/system/memory/memory4/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory5 -> 
../../../devices/system/memory/memory5/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory6 -> 
../../../devices/system/memory/memory6/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory7 -> 
../../../devices/system/memory/memory7/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory8 -> 
../../../devices/system/memory/memory8/
  lrwxrwxrwx 1 root root 0 Aug 24 09:43 memory9 -> 
../../../devices/system/memory/memory9/

  lsmem shows:
  root@UBU9LT1:/sys/bus/memory/devices# lsmem -a
  Address Range                          Size (MB)  State    Removable  Device
  
===============================================================================
  0x0000000000000000-0x000000000fffffff        256  online   no         0-31
  0x0000000010000000-0x000000001fffffff        256  online   yes        32-63
  0x0000000020000000-0x000000002fffffff        256  online   yes        64-95
  0x0000000030000000-0x000000003fffffff        256  online   yes        96-127
  0x0000000040000000-0x000000004fffffff        256  online   yes        128-159
  0x0000000050000000-0x000000005fffffff        256  online   yes        160-191
  0x0000000060000000-0x000000006fffffff        256  online   yes        192-223
  0x0000000070000000-0x000000007fffffff        256  online   no         224-255
  0x0000000080000000-0x000000008fffffff        256  online   yes        256-287
  0x0000000090000000-0x000000009fffffff        256  online   no         288-319
  0x00000000b0000000-0x00000000bfffffff        256  offline  -          352-383
  0x00000000c0000000-0x00000000cfffffff        256  offline  -          384-415
  0x00000000d0000000-0x00000000dfffffff        256  offline  -          416-447

  although there is 1GB of memory in standby and reserved i can only
  vary online 768MB as there are only 3 offline blocks... there should
  be 4 blocks available... specifically block number 10 is missing

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1618203/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to