[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 49/49] Clear mem_path if we fall back to anonymous RAM
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 49/49] Clear mem_path if we fall back to anonymous RAM allocation |
Date: |
Fri, 27 Apr 2018 19:21:26 +1000 |
If the -mem-path option is set, we attempt to map the guest's RAM from a
file in the given path; it's usually used to back guest RAM with hugepages.
If we're unable to (e.g. not enough free hugepages) then we fall back to
allocating normal anonymous pages. This behaviour can be surprising, but a
comment in allocate_system_memory_nonnuma() suggests it's legacy behaviour
we can't change.
What really isn't ok, though, is that in this case we leave mem_path set.
That means functions which attempt to determine the pagesize of main RAM
can erroneously think it is hugepage based on the requested path, even
though it's not.
This is particular bad for the pseries machine type. KVM HV limitations
mean the guest can't use pagesizes larger than the host page size used to
back RAM. That means that such a fallback, rather than merely giving
poorer performance than expected will cause the guest to freeze up early in
boot as it attempts to use large page mappings that can't work.
This patch addresses the problem by clearing the mem_path variable when we
fall back to anonymous pages, meaning that subsequent attempts to
determine the RAM page size will get an accurate result.
Signed-off-by: David Gibson <address@hidden>
---
numa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/numa.c b/numa.c
index 1116c90af9..78a869e598 100644
--- a/numa.c
+++ b/numa.c
@@ -469,6 +469,7 @@ static void allocate_system_memory_nonnuma(MemoryRegion
*mr, Object *owner,
/* Legacy behavior: if allocation failed, fall back to
* regular RAM allocation.
*/
+ mem_path = NULL;
memory_region_init_ram_nomigrate(mr, owner, name, ram_size,
&error_fatal);
}
#else
--
2.14.3
- [Qemu-ppc] [PULL 41/49] target/ppc: Remove unnecessary POWERPC_MMU_V3 flag from mmu_model, (continued)
- [Qemu-ppc] [PULL 41/49] target/ppc: Remove unnecessary POWERPC_MMU_V3 flag from mmu_model, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 47/49] target/ppc: Don't bother with MSR_EP in cpu_ppc_set_papr(), David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 29/49] Revert "spapr: Don't allow memory hotplug to memory less nodes", David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 26/49] Make qemu_mempath_getpagesize() accept NULL, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 44/49] spapr: Add ibm, max-associativity-domains property, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 43/49] target/ppc: Fold slb_nr into PPCHash64Options, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 45/49] ppc: e500: switch E500 based machines to full machine definition, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 32/49] target/ppc: Simplify cpu valid check in ppc_cpu_realize, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 35/49] target/ppc: Remove fallback 64k pagesize information, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 36/49] target/ppc: Move page size setup to helper function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 49/49] Clear mem_path if we fall back to anonymous RAM allocation,
David Gibson <=
- [Qemu-ppc] [PULL 46/49] spapr: Support ibm, dynamic-memory-v2 property, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 48/49] spapr: Set compatibility mode before the rest of spapr_cpu_reset(), David Gibson, 2018/04/27
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/49] ppc-for-2.13 queue 20180427, no-reply, 2018/04/27
- Re: [Qemu-ppc] [PULL 00/49] ppc-for-2.13 queue 20180427, Peter Maydell, 2018/04/27