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]
Date:   Tue, 10 Dec 2019 10:32:34 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Baoquan He <bhe@...hat.com>, linux-kernel@...r.kernel.org
Cc:     linux-mm@...ck.org, mhocko@...nel.org, jgross@...e.com,
        akpm@...ux-foundation.org
Subject: Re: [Patch v2] mm/hotplug: Only respect mem= parameter during boot
 stage

On 10.12.19 09:44, Baoquan He wrote:
> In commit 357b4da50a62 ("x86: respect memory size limiting via mem=
> parameter") a global varialbe global max_mem_size is added to store

Only some nits:

s/varialbe global/variable/

> the value parsed from 'mem= ', then checked when memory region is
> added. This truly stops those DIMM from being added into system memory
s/DIMM/DIMMs/

> during boot-time.
> 
> However, it also limits the later memory hotplug functionality. Any
> memory board can't be hot added any more if its region is beyond the

s/memory board/DIMM/ ?

s/hot added/hotplugged/ ?

> max_mem_size. System will print error like below:

"We will get errors like:"

> 
> [  216.387164] acpi PNP0C80:02: add_memory failed
> [  216.389301] acpi PNP0C80:02: acpi_memory_enable_device() error
> [  216.392187] acpi PNP0C80:02: Enumeration failure
> 
> From document of 'mem= ' parameter, it should be a restriction during

"the documentation of the"

> boot, but not impact the system memory adding/removing after booting.

"but not impact memory hotplug once booted."

> 
>   mem=nn[KMG]     [KNL,BOOT] Force usage of a specific amount of memory
> 	          ...
> 
> So fix it by also checking if it's during boot-time when restrict memory

s/when restrict memory adding/restricting to add memory/

> adding. Otherwise, skip the restriction.
> 
> Fixes: 357b4da50a62 ("x86: respect memory size limiting via mem= parameter")
> Signed-off-by: Baoquan He <bhe@...hat.com>
> ---
>  mm/memory_hotplug.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 55ac23ef11c1..989707295d15 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -105,7 +105,11 @@ static struct resource *register_memory_resource(u64 start, u64 size)
>  	unsigned long flags =  IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
>  	char *resource_name = "System RAM";
>  
> -	if (start + size > max_mem_size)
> +	/*
> +	 * Make sure value parsed from 'mem=' only restricts memory adding
> +	 * during boot-time, so that memory hotplug won't be impacted.

s/during boot-time/while booting/

Only some nits, thanks!

Reviewed-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ