[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/11] pc: count in 1Gb hugepage alignment when sizi
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 11/11] pc: count in 1Gb hugepage alignment when sizing hotplug-memory container |
Date: |
Fri, 31 Oct 2014 16:38:42 +0000 |
if DIMMs with mized size/alignment are interleaved
in creation order it could lead 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
creates fragment hotplug-memory container and doesn't
allow to use 1GB hugepage backend to cosume remainig 1Gb.
To ease managment factor 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>
---
hw/i386/pc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 0d9681e..9d2f800 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1288,6 +1288,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,
--
1.8.3.1
- [Qemu-devel] [PATCH 01/11] pc: kvm: check if KVM has free memory slots to avoid abort(), (continued)
- [Qemu-devel] [PATCH 01/11] pc: kvm: check if KVM has free memory slots to avoid abort(), Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 02/11] kvm: provide API to query amount of memory slots supported by KVM, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 03/11] pc: check if KVM has enough memory slots for DIMM devices, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 04/11] pc: make pc_dimm_plug() more readble, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 05/11] pc: limit DIMM address and size to page aligned values, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 06/11] memory: expose alignment used for allocating RAM as MemoryRegion API, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 08/11] pc: align DIMM's address/size by backend's alignment value, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 07/11] pc: add pc_init_pci_2_1() and pc_compat_2_1(), Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 09/11] pc: pc-dimm: use backend alignment during address auto allocation, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 10/11] pc: explicitly check maxmem limit when adding DIMM, Igor Mammedov, 2014/10/31
- [Qemu-devel] [PATCH 11/11] pc: count in 1Gb hugepage alignment when sizing hotplug-memory container,
Igor Mammedov <=