Message ID | 1568001906-5750-1-git-send-email-kernelfans@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | powerpc/crashkernel: take mem option into account | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch next (c317052c95bef1f977b023158e5aa929215f443d) |
snowpatch_ozlabs/build-ppc64le | success | Build succeeded |
snowpatch_ozlabs/build-ppc64be | success | Build succeeded |
snowpatch_ozlabs/build-ppc64e | success | Build succeeded |
snowpatch_ozlabs/build-pmac32 | success | Build succeeded |
snowpatch_ozlabs/checkpatch | warning | total: 0 errors, 0 warnings, 1 checks, 14 lines checked |
On Mon, Sep 9, 2019 at 12:05 PM Pingfan Liu <kernelfans@gmail.com> wrote: > > 'mem=" option is an easy way to put high pressure on memory during some > test. Hence in stead of total mem, the effective usable memory size should > be considered when reserving mem for crashkernel. Otherwise the boot up may > experience oom issue. > > E.g passing > crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G", and > mem=5G. > > Signed-off-by: Pingfan Liu <kernelfans@gmail.com> > Cc: Hari Bathini <hbathini@linux.ibm.com> > Cc: Michael Ellerman <mpe@ellerman.id.au> > To: linuxppc-dev@lists.ozlabs.org > --- > arch/powerpc/kernel/machine_kexec.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c > index c4ed328..714b733 100644 > --- a/arch/powerpc/kernel/machine_kexec.c > +++ b/arch/powerpc/kernel/machine_kexec.c > @@ -114,11 +114,12 @@ void machine_kexec(struct kimage *image) > > void __init reserve_crashkernel(void) > { > - unsigned long long crash_size, crash_base; > + unsigned long long crash_size, crash_base, total_mem_sz; > int ret; > > + total_mem_sz = memory_limit ? memory_limit : memblock_phys_mem_size(); Here memory_limit is used to esstimation and may be changed. So I think it is better to use memory_limit here than moving memblock_enforce_memory_limit() before the call to reserve_crashkernel() Thanks, Pingfan > /* use common parsing */ > - ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), > + ret = parse_crashkernel(boot_command_line, total_mem_sz, > &crash_size, &crash_base); > if (ret == 0 && crash_size > 0) { > crashk_res.start = crash_base; > -- > 2.7.5 >
NACK it. Due to a miss the updating of printk info. I will send out V2 On Mon, Sep 9, 2019 at 12:05 PM Pingfan Liu <kernelfans@gmail.com> wrote: > > 'mem=" option is an easy way to put high pressure on memory during some > test. Hence in stead of total mem, the effective usable memory size should > be considered when reserving mem for crashkernel. Otherwise the boot up may > experience oom issue. > > E.g passing > crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G", and > mem=5G. > > Signed-off-by: Pingfan Liu <kernelfans@gmail.com> > Cc: Hari Bathini <hbathini@linux.ibm.com> > Cc: Michael Ellerman <mpe@ellerman.id.au> > To: linuxppc-dev@lists.ozlabs.org > --- > arch/powerpc/kernel/machine_kexec.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c > index c4ed328..714b733 100644 > --- a/arch/powerpc/kernel/machine_kexec.c > +++ b/arch/powerpc/kernel/machine_kexec.c > @@ -114,11 +114,12 @@ void machine_kexec(struct kimage *image) > > void __init reserve_crashkernel(void) > { > - unsigned long long crash_size, crash_base; > + unsigned long long crash_size, crash_base, total_mem_sz; > int ret; > > + total_mem_sz = memory_limit ? memory_limit : memblock_phys_mem_size(); > /* use common parsing */ > - ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), > + ret = parse_crashkernel(boot_command_line, total_mem_sz, > &crash_size, &crash_base); > if (ret == 0 && crash_size > 0) { > crashk_res.start = crash_base; > -- > 2.7.5 >
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index c4ed328..714b733 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c @@ -114,11 +114,12 @@ void machine_kexec(struct kimage *image) void __init reserve_crashkernel(void) { - unsigned long long crash_size, crash_base; + unsigned long long crash_size, crash_base, total_mem_sz; int ret; + total_mem_sz = memory_limit ? memory_limit : memblock_phys_mem_size(); /* use common parsing */ - ret = parse_crashkernel(boot_command_line, memblock_phys_mem_size(), + ret = parse_crashkernel(boot_command_line, total_mem_sz, &crash_size, &crash_base); if (ret == 0 && crash_size > 0) { crashk_res.start = crash_base;
'mem=" option is an easy way to put high pressure on memory during some test. Hence in stead of total mem, the effective usable memory size should be considered when reserving mem for crashkernel. Otherwise the boot up may experience oom issue. E.g passing crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G", and mem=5G. Signed-off-by: Pingfan Liu <kernelfans@gmail.com> Cc: Hari Bathini <hbathini@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> To: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/machine_kexec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)