On aarch64, both 4K and 64K kernel can be installed, while they demand
different size reserved memory for kdump kernel.
'get_conf PAGE_SIZE' can not work if installing a 64K kernel when
running a 4K kernel. Hence resorting to the kernel release naming rules.
At present, the 64K kernel has the keyword '64k' in its suffix.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdump-lib.sh | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 6b0a83d..d5d13bc 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -908,6 +908,7 @@ get_recommend_size()
# get default crashkernel
# $1 dump mode, if not specified, dump_mode will be judged by is_fadump_capable
+# $2 kernel-release, if not specified, got by 'uname -r'
kdump_get_arch_recommend_crashkernel()
{
local _arch _ck_cmdline _dump_mode
@@ -927,8 +928,21 @@ kdump_get_arch_recommend_crashkernel()
if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
_ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
elif [[ $_arch == "aarch64" ]]; then
- # For 4KB page size, the formula is based on x86 plus extra = 64M
- _ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
+ local _running_kernel
+
+ if [[ -z "$2" ]]; then
+ _running_kernel=$(uname -r)
+ else
+ _running_kernel=$2
+ fi
+
+ if echo "$_running_kernel" | grep 64k; then
+ # For 64KB page size
+ _ck_cmdline="2G-:480M"
+ else
+ # For 4KB page size, the formula is based on x86 plus extra = 64M
+ _ck_cmdline="1G-4G:256M,4G-64G:320M,64G-:576M"
+ fi
elif [[ $_arch == "ppc64le" ]]; then
if [[ $_dump_mode == "fadump" ]]; then
_ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
--
2.31.1