lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201005171248.GB14576@gaia>
Date:   Mon, 5 Oct 2020 18:12:49 +0100
From:   Catalin Marinas <catalin.marinas@....com>
To:     Chen Zhou <chenzhou10@...wei.com>
Cc:     will@...nel.org, james.morse@....com, tglx@...utronix.de,
        mingo@...hat.com, dyoung@...hat.com, bhe@...hat.com,
        corbet@....net, John.P.donnelly@...cle.com,
        prabhakar.pkin@...il.com, bhsharma@...hat.com, horms@...ge.net.au,
        robh+dt@...nel.org, arnd@...db.de, nsaenzjulienne@...e.de,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        kexec@...ts.infradead.org, linux-doc@...r.kernel.org,
        guohanjun@...wei.com, xiexiuqi@...wei.com, huawei.libin@...wei.com,
        wangkefeng.wang@...wei.com
Subject: Re: [PATCH v12 7/9] kdump: add threshold for the required memory

On Mon, Sep 07, 2020 at 09:47:43PM +0800, Chen Zhou wrote:
> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
> index 3f735cb37ace..d11d597a470d 100644
> --- a/kernel/crash_core.c
> +++ b/kernel/crash_core.c
> @@ -378,6 +378,15 @@ int __init reserve_crashkernel_low(void)
>  }
>  
>  #if defined(CONFIG_X86) || defined(CONFIG_ARM64)
> +
> +/*
> + * Add a threshold for required memory size of crashkernel. If required memory
> + * size is greater than threshold, just go for high allocation directly. The
> + * value of threshold is set as half of the total low memory.
> + */
> +#define REQUIRED_MEMORY_THRESHOLD	(memblock_mem_size(CRASH_ADDR_LOW_MAX >> \
> +			PAGE_SHIFT) >> 1)
> +
>  #ifdef CONFIG_KEXEC_CORE
>  /*
>   * reserve_crashkernel() - reserves memory for crash kernel
> @@ -422,7 +431,7 @@ void __init reserve_crashkernel(void)
>  		 * So try low memory first and fall back to high memory
>  		 * unless "crashkernel=size[KMG],high" is specified.
>  		 */
> -		if (!high)
> +		if (!high && crash_size <= REQUIRED_MEMORY_THRESHOLD)
>  			crash_base = memblock_find_in_range(CRASH_ALIGN,
>  						CRASH_ADDR_LOW_MAX,
>  						crash_size, CRASH_ALIGN);

Since any change now is affecting the x86 semantics slightly, I'd
suggest you drop this patch. We can add it later if needed, once the
core changes are in.

Thinking about this, if one requires a crashkernel reservation that
allocates all of the ZONE_DMA, it would probably be noticed and explicit
,high/,low options can be used.

Note that we are also trying to make ZONE_DMA full 32-bit on non-RPi4
hardware.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ