AmpereComputing / ampere-lts-kernel

Linux 5.4 and 5.10 Longterm kernel (LTS) with Ampere patches
21 stars 17 forks source link

verify kdump using patchset: support reserving crashkernel above 4G on arm64 kdump #164

Open adamliyi opened 2 years ago

adamliyi commented 2 years ago

Test kdump using latest upstream linus tree.

  1. set kernel option: crashkernel=4G. Boot kernel and dmesg | grep crashkernel. Very likely crashkernel memory cannot be reserved, since by default on arm64 crashkernel will allocate bellow 4G.
  2. Apply upstream patch: [PATCH v21 0/5] support reserving crashkernel above 4G on arm64 kdump: https://lkml.org/lkml/2022/2/26/350
  3. Try option: crashkernel=4G
  4. Try option: crashkernel=4G crashkernel=16M,low
  5. Try kdump if crashkernel memory can be reserved.

Before the patch, these option should fail:

`crashkernel=4G`  // fail. by default kernel try to allocate bellow 4GB
`crashkernel=4G crashkernel=16M,low` //fail, low option not supported

After the patch, bellow option should be supported:

The test cases are as follows: (Please update the kexec tool to the latest version)
1) crashkernel=4G                       //high=4G, low=256M
2) crashkernel=4G crashkernel=512M,high crashkernel=512M,low    //high=4G, low=256M, high and low are ignored
3) crashkernel=4G crashkernel=512M,high             //high=4G, low=256M, high is ignored
4) crashkernel=4G crashkernel=512M,low              //high=4G, low=256M, low is ignored
5) crashkernel=4G@0xe0000000                    //high=0G, low=0M, cannot allocate, failed
6) crashkernel=512M                     //high=0G, low=512M
7) crashkernel=128M                     //high=0G, low=128M
8) crashkernel=512M@0xde000000      //512M@3552M        //high=0G, low=512M
9) crashkernel=4G,high                      //high=4G, low=256M
a) crashkernel=4G,high crashkernel=512M,low         //high=4G, low=512M
b) crashkernel=512M,high crashkernel=128M,low           //high=512M, low=128M
c) crashkernel=128M,high                    //high=128M, low=256M
d) crashkernel=512M,low                     //high=0G, low=0M, invalid
e) crashkernel=512M,high crashkernel=0,low          //high=512M, low=0M
f) crashkernel=4G,high crashkernel=ab,low           //high=0G, low=0M, invalid
bobolmw commented 2 years ago

Test result based on latest linus master branch in ampere platform:

  1. without patch: cannot allocate memory
  2. with option 'crashkernel=4G', kdump works, 256MB low memory reserverd, dump file generated
  3. with option 'crashkernel=4G crashkernel=512MB,low', kdump works, 256MB low memory reserverd, dump file generated
adamliyi commented 2 years ago

Updated on 05/05/2022: patch backported to 5.15 Longterm kernel: https://github.com/AmpereComputing/ampere-lts-kernel/pull/165

adamliyi commented 2 years ago

https://lore.kernel.org/linux-arm-kernel/20220414115720.1887-1-thunder.leizhen@huawei.com/ V22 of the patch has been posted on 2022-04-14, will keep testing and tracking.