linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [Xen-devel] [PATCH 2/2] x86/xen: dont add memory above max allowed allocation
@ 2019-01-22  9:09 Juergen Gross
  0 siblings, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2019-01-22  9:09 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Borislav Petkov, Stefano Stabellini, the arch/x86 maintainers,
	linux-mm, Thomas Gleixner, xen-devel, Boris Ostrovsky, mingo,
	lkml, H. Peter Anvin

On 22/01/2019 09:52, Jan Beulich wrote:
>>>> On 22.01.19 at 09:06, <jgross@suse.com> wrote:
>> Don't allow memory to be added above the allowed maximum allocation
>> limit set by Xen.
> 
> This reads as if the hypervisor was imposing a limit here, but looking at
> xen_get_max_pages(), xen_foreach_remap_area(), and
> xen_count_remap_pages() I take it that it's a restriction enforced by
> the Xen subsystem in Linux. Furthermore from the cover letter I imply
> that the observed issue was on a Dom0, yet xen_get_max_pages()'s
> use of XENMEM_maximum_reservation wouldn't impose any limit there
> at all (without use of the hypervisor option "dom0_mem=max:..."),
> would it?

Oh yes, you are right, of course!

I need to check the current reservation and adjust the allowed limit
in case of ballooning and/or memory hotplug.

Thanks for noticing that!


Juergen

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [PATCH 0/2] x86: respect memory size limits
@ 2019-01-22  8:06 Juergen Gross
  2019-01-22  8:06 ` [PATCH 2/2] x86/xen: dont add memory above max allowed allocation Juergen Gross
  0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2019-01-22  8:06 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86, linux-mm
  Cc: boris.ostrovsky, sstabellini, hpa, tglx, mingo, bp, Juergen Gross

On a customer system running Xen a boot problem was observed due to
the kernel not respecting the memory size limit imposed by the Xen
hypervisor.

During analysis I found the same problem should be able to occur on
bare metal in case the memory would be limited via the "mem=" boot
parameter.

The system this problem has been observed on has tons of memory
added via PCI. So while in the E820 map the not to be used memory has
been wiped out the additional PCI memory is detected during ACPI scan
and it is added via __add_memory().

This small series tries to repair the issue by testing the imposed
memory limit during the memory hotplug process and refusing to add it
in case the limit is being violated.

I've chosen to refuse adding the complete memory chunk in case the
limit is reached instead of adding only some of the memory, as I
thought this would result in less problems (e.g. avoiding to add
only parts of a 128MB memory bar which might be difficult to remove
later).


Juergen Gross (2):
  x86: respect memory size limiting via mem= parameter
  x86/xen: dont add memory above max allowed allocation

 arch/x86/kernel/e820.c         | 5 +++++
 arch/x86/xen/setup.c           | 5 +++++
 include/linux/memory_hotplug.h | 2 ++
 mm/memory_hotplug.c            | 6 ++++++
 4 files changed, 18 insertions(+)

-- 
2.16.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-22  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22  9:09 [Xen-devel] [PATCH 2/2] x86/xen: dont add memory above max allowed allocation Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2019-01-22  8:06 [PATCH 0/2] x86: respect memory size limits Juergen Gross
2019-01-22  8:06 ` [PATCH 2/2] x86/xen: dont add memory above max allowed allocation Juergen Gross
2019-01-22  8:52   ` [Xen-devel] " Jan Beulich
2019-01-22  8:52     ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox