-
Notifications
You must be signed in to change notification settings - Fork 92
kernel: Add memory hotplug(add) support for arm64 #312
Conversation
As memory hotplug for arm64 by acpi is not ready on qemu, we choose "probe" instead. You can refer to [1] to get more infomation about "probe". The process of memory hotplug by "probe" in kata lies below: firstly, add memory in qemu qmp; secondly, echo the start phyical address of that memory to /sys/devices/system/memory/probe, which will be done through kata-agent; thirdly, excute online op, then this newly added memory is capable to be used. All functions in this patch will be called after "echo" op. It can be divided into two parts: 1. create page table for that memory; 2. add that memory to memblock. In this patch, NUMA must be turned off for not all arm64 machine supports NUMA. As the newly added memory should be placed from 2T to 6T which is decided in qemu and phyical address and virtual address will be one-one mapping when create pgd for that memory, we must config ARM64_VA_BITS as 48. Also some configs should be turned on, especially "ARCH_MEMORY_PROBE". We have tested this patch integrated with another patch which performed that echo op. It works well when using "-m" in command line when start a kata-container on aarch64 machine. This patch derived from Maciej Bielski. You can refer to [2] to get full infomation about it. [1] https://www.kernel.org/doc/Documentation/memory-hotplug.txt [2] https://lkml.org/lkml/2017/11/23/183 Fixes: kata-containers#309 Signed-off-by: Jianyong Wu <[email protected]> Signed-off-by: Jia He <[email protected]> Signed-off-by: Penny Zheng <[email protected]>
Fixes: kata-containers#309 Signed-off-by: Jianyong Wu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @jongwu
lgtm
@grahamwhaley @jodh-intel any comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jongwu.
lgtm
@@ -9,7 +9,7 @@ CONFIG_MMU=y | |||
CONFIG_ARM64_PAGE_SHIFT=12 | |||
CONFIG_ARM64_CONT_SHIFT=4 | |||
CONFIG_ARCH_MMAP_RND_BITS_MIN=18 | |||
CONFIG_ARCH_MMAP_RND_BITS_MAX=24 | |||
CONFIG_ARCH_MMAP_RND_BITS_MAX=33 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @grahamwhaley - x86_64 specifies 32 here whilst ppc64 specifies 33. Should we do 34? 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh heh - this is probably quite arch specific, to do with MMU mmaps - so, expect them to maybe be different.
For ref, the x86 kernel config arch files have some defaults if not set (different for 32 and 64 bit - I'll just list the 64bit ones):
- MAX 32
- MIN 28
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
nice :-)
@@ -1,6 +1,6 @@ | |||
# | |||
# Automatically generated file; DO NOT EDIT. | |||
# Linux/arm64 4.14.72 Kernel Configuration | |||
# Linux/arm64 4.14.67 Kernel Configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slightly odd having the kernel version go down - I guess you are testing on a kernel not quite as recent as the original - I'll let you decide if that is right or not ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grahamwhaley we change it from 72 to 67 according to the kernel version setting in runtime/versions.yaml.
as kernel version in https://cdn.kernel.org/pub/linux/kernel/v4.x/ is upper than 67, maybe we can upgrade it in runtime/version.yaml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we have 67 in our versions.yaml file. Should be in sync.
even though afaik this will not get tested on the ARM CI - I'm going to fire the tests on it anyway to make it clearer this is probably mergeable... |
@grahamwhaley - any update on that ARM CI run? |
As noted, the ARM CI is not enabled for this repo. I believe ARM CI is only enabled for the proxy repo - I'll open a different Issue to discuss enabling that further...
|
Seems like a network issue:
Sending rebuild |
Merging this, as CI has passed now. |
@jon @liwei @jbryce @gnawux @Pennyzct