[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 09/15] pc: count in 1Gb hugepage alignment when si
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 09/15] pc: count in 1Gb hugepage alignment when sizing hotplug-memory container |
Date: |
Mon, 24 Nov 2014 21:31:17 +0200 |
From: Igor Mammedov <address@hidden>
if DIMMs with different size/alignment are interleaved
in creation order, it could lead to hotplug-memory
container fragmentation and following inability to use
all RAM upto maxmem.
For example:
-m 4G,slots=3,maxmem=7G
-object memory-backend-file,id=mem-1,size=256M,mem-path=/pagesize-2MB
-device pc-dimm,id=mem1,memdev=mem-1
-object memory-backend-file,id=mem-2,size=1G,mem-path=/pagesize-1GB
-device pc-dimm,id=mem2,memdev=mem-2
-object memory-backend-file,id=mem-3,size=256M,mem-path=/pagesize-2MB
-device pc-dimm,id=mem3,memdev=mem-3
fragments hotplug-memory container and doesn't allow
to use 1GB hugepage backend to consume remainig 1Gb.
To ease managment factor count in max 1Gb alignment for
each memory slot when sizing hotplug-memory region so
that regadless of fragmentaion it would be possible to
add max aligned DIMM.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/pc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 3d732cf..8be50a4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1247,6 +1247,11 @@ FWCfgState *pc_memory_init(MachineState *machine,
pcms->hotplug_memory_base =
ROUND_UP(0x100000000ULL + above_4g_mem_size, 1ULL << 30);
+ if (pcms->enforce_aligned_dimm) {
+ /* size hotplug region assuming 1G page max alignment per slot */
+ hotplug_mem_size += (1ULL << 30) * machine->ram_slots;
+ }
+
if ((pcms->hotplug_memory_base + hotplug_mem_size) <
hotplug_mem_size) {
error_report("unsupported amount of maximum memory: " RAM_ADDR_FMT,
--
MST
- [Qemu-devel] [PULL v2 00/15] pc, pci, misc bugfixes, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 01/15] qemu-char: fix tcp_get_fds, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 02/15] pc: kvm: check if KVM has free memory slots to avoid abort(), Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 03/15] pc: make pc_dimm_plug() more readble, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 04/15] pc: limit DIMM address and size to page aligned values, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 05/15] memory: expose alignment used for allocating RAM as MemoryRegion API, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 06/15] pc: align DIMM's address/size by backend's alignment value, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 09/15] pc: count in 1Gb hugepage alignment when sizing hotplug-memory container,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 11/15] acpi-build: mark RAM dirty on table update, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 07/15] pc: pc-dimm: use backend alignment during address auto allocation, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 12/15] target-i386: move generic memory hotplug methods to DSDTs, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 13/15] pcie: fix typo in pcie_cap_deverr_init(), Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 14/15] pcie: fix improper use of negative value, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 15/15] pc: acpi: mark all possible CPUs as enabled in SRAT, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 08/15] pc: explicitly check maxmem limit when adding DIMM, Michael S. Tsirkin, 2014/11/24
- [Qemu-devel] [PULL v2 10/15] hw/pci: fix crash on shpc error flow, Michael S. Tsirkin, 2014/11/24
- Re: [Qemu-devel] [PULL v2 00/15] pc, pci, misc bugfixes, Peter Maydell, 2014/11/25