linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Baoquan He <bhe@redhat.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, akpm@linux-foundation.org, mhocko@kernel.org,
	jgross@suse.com, bsingharora@gmail.com
Subject: Re: [PATCH v3] mm/hotplug: Only respect mem= parameter during boot stage
Date: Thu, 6 Feb 2020 09:55:58 +0100	[thread overview]
Message-ID: <e374a011-4f13-ee7a-fc31-dae6878037d4@redhat.com> (raw)
In-Reply-To: <20200204050643.20925-1-bhe@redhat.com>

On 04.02.20 06:06, Baoquan He wrote:
> In commit 357b4da50a62 ("x86: respect memory size limiting via mem=
> parameter") a global varialbe max_mem_size is added to store
> the value parsed from 'mem= ', then checked when memory region is
> added. This truly stops those DIMMs from being added into system memory
> during boot-time.
> 
> However, it also limits the later memory hotplug functionality. Any
> DIMM can't be hotplugged any more if its region is beyond the
> max_mem_size. 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
> 
> This will cause issue in a known use case where 'mem=' is added to
> the hypervisor. The memory that lies after 'mem=' boundary will be
> assigned to KVM guests. After commit 357b4da50a62 merged, memory
> can't be extended dynamically if system memory on hypervisor is not
> sufficient.
> 
> So fix it by also checking if it's during boot-time restricting to add
> memory. Otherwise, skip the restriction.
> 
> And also add this use case to document of 'mem=' kernel parameter.
> 
> Fixes: 357b4da50a62 ("x86: respect memory size limiting via mem= parameter")
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
> v2->v3:
>   In discussion of v1 and v2, People have concern about the use case
>   related to the code change. So add the use case into patch log and
>   document of 'mem=' in kernel-parameters.txt.
> 
>  Documentation/admin-guide/kernel-parameters.txt | 13 +++++++++++--
>  mm/memory_hotplug.c                             |  8 +++++++-
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index ddc5ccdd4cd1..b809767e5f74 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -2533,13 +2533,22 @@
>  			For details see: Documentation/admin-guide/hw-vuln/mds.rst
>  
>  	mem=nn[KMG]	[KNL,BOOT] Force usage of a specific amount of memory
> -			Amount of memory to be used when the kernel is not able
> -			to see the whole system memory or for test.
> +			Amount of memory to be used in cases as follows:
> +
> +			1 for test;
> +			2 when the kernel is not able to see the whole system memory;
> +			3 memory that lies after 'mem=' boundary is excluded from
> +			 the hypervisor, then assigned to KVM guests.

I remember that there were more use cases, but forgot where that was
documented :)

I do wonder if we want to change that now without anybody complaining.
Yes, I brought up a possible use case but don't know if it is relevant
in practice (IOW, nobody complained yet :) ).

Would like to get Michals opinion on this.

-- 
Thanks,

David / dhildenb



  parent reply	other threads:[~2020-02-06  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04  5:06 Baoquan He
2020-02-04  7:53 ` Jürgen Groß
2020-02-06  2:58   ` Baoquan He
2020-02-06  8:55 ` David Hildenbrand [this message]
2020-02-06  9:44   ` Baoquan He
2020-02-14 10:53 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e374a011-4f13-ee7a-fc31-dae6878037d4@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=bsingharora@gmail.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox