[PATCHv4] powerpc/crashkernel: take "mem=" option into account

Hari Bathini hbathini at linux.ibm.com
Thu Apr 2 05:36:01 AEDT 2020



On 01/04/20 7:30 PM, Pingfan Liu wrote:
> 'mem=" option is an easy way to put high pressure on memory during some
> test. Hence after applying the memory limit, instead of total mem, the
> actual usable memory should be considered when reserving mem for
> crashkernel. Otherwise the boot up may experience OOM issue.
> 
> E.g. it would reserve 4G prior to the change and 512M afterward, if passing
> crashkernel="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G", and
> mem=5G on a 256G machine.
> 
> This issue is powerpc specific because it puts higher priority on fadump
> and kdump reservation than on "mem=". Referring the following code:
>     if (fadump_reserve_mem() == 0)
>             reserve_crashkernel();
>     ...
>     /* Ensure that total memory size is page-aligned. */
>     limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
>     memblock_enforce_memory_limit(limit);
> 
> While on other arches, the effect of "mem=" takes a higher priority and pass
> through memblock_phys_mem_size() before calling reserve_crashkernel().
>> Signed-off-by: Pingfan Liu <kernelfans at gmail.com>
> To: linuxppc-dev at lists.ozlabs.org
> Cc: Hari Bathini <hbathini at linux.ibm.com>
> Cc: Michael Ellerman <mpe at ellerman.id.au>
> Cc: kexec at lists.infradead.org
> ---
> v3 -> v4: fix total_mem_sz based on adjusted memory_limit


Thanks for the update.

Reviewed-by: Hari Bathini <hbathini at linux.ibm.com>



More information about the Linuxppc-dev mailing list