Skip to contentSkip to conversation

KVM: PPC: Increase memslots

PATCH In review Thomas Huth 2 participants 5 messages Nov 4, 2015 – Dec 9, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover KVM: PPC: Increase memslots

Now that the patch from Nikunj to support the KVM_CAP_NR_MEMSLOTS capability on powerpc has been merged to kvm/next, we can/should increase the amount of memslots on ppc, too.
Since nobody else sent a patch yet (as far as I can see), I'd like to suggest to increase the slot number to 320 now. Why 320? Well, x86 uses 509 (+3 internal slots), to give enough space for 256 pluggable DIMMs and 253 other slots (for PCI etc.). On powerpc, QEMU only supports 32 pluggable DIMMs, so I think we should be fine by using something around 253 + 32 slots + some few extra ... so 320 sounds like a good value to me for the time being (but in the long run, we should really make this dynamically instead, I think).

Thomas Huth (1):
KVM: PPC: Increase memslots to 320

 arch/powerpc/include/asm/kvm_host.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 KVM: PPC: Increase memslots to 320

Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for other things like PCI devices. On powerpc, we only have 32 pluggable DIMMs in QEMU, not 256, so we likely do not as much slots as on x86. Thus setting the slot limit to 320 sounds like a good value for the time being (until we have some code in the future to resize the memslot array dynamically).
And while we're at it, also remove the KVM_MEM_SLOTS_NUM definition from the powerpc-specific header since this gets defined in the generic kvm_host.h header anyway.

---
 arch/powerpc/include/asm/kvm_host.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/include/asm/kvm_host.h +1 -2
index 887c259..89d387a 100644
@@ -38,8 +38,7 @@
 
 #define KVM_MAX_VCPUS		NR_CPUS
 #define KVM_MAX_VCORES		NR_CPUS
-#define KVM_USER_MEM_SLOTS 32
-#define KVM_MEM_SLOTS_NUM KVM_USER_MEM_SLOTS
+#define KVM_USER_MEM_SLOTS 320
 
 #ifdef CONFIG_KVM_MMIO
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [PATCH 1/1] KVM: PPC: Increase memslots to 320

Quoted 25 lines · Thomas Huth

Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for other things like PCI devices. On powerpc, we only have 32 pluggable DIMMs in QEMU, not 256, so we likely do not as much slots as on x86. Thus setting the slot limit to 320 sounds like a good value for the time being (until we have some code in the future to resize the memslot array dynamically).
And while we're at it, also remove the KVM_MEM_SLOTS_NUM definition from the powerpc-specific header since this gets defined in the generic kvm_host.h header anyway.

---
 arch/powerpc/include/asm/kvm_host.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/include/asm/kvm_host.h +0 -0
index 887c259..89d387a 100644

arch/powerpc/include/asm/kvm_host.h line 44

Quoted 9 lines
arch/powerpc/include/asm/kvm_host.h +1 -2
@@ -38,8 +38,7 @@
 
 #define KVM_MAX_VCPUS		NR_CPUS
 #define KVM_MAX_VCORES		NR_CPUS
-#define KVM_USER_MEM_SLOTS 32
-#define KVM_MEM_SLOTS_NUM KVM_USER_MEM_SLOTS
+#define KVM_USER_MEM_SLOTS 320
 
 #ifdef CONFIG_KVM_MMIO
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1

Ping! ... any comments on this one?

Thomas

#3 lore raw

Re: [PATCH 1/1] KVM: PPC: Increase memslots to 320

In reply to Thomas Huth
Quoted 6 lines · Thomas Huth

Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for other things like PCI devices. On powerpc, we only have 32 pluggable DIMMs in

I agree with increasing the limit. Is there a reason we have only 32 pluggable DIMMs in QEMU on powerpc, not more? Should we be increasing that limit too? If so, maybe we should increase the number of memory slots to 512?

Quoted 1 line

QEMU, not 256, so we likely do not as much slots as on x86. Thus

"so we likely do not need as many slots as on x86" would be better English.

Quoted 8 lines

setting the slot limit to 320 sounds like a good value for the time being (until we have some code in the future to resize the memslot array dynamically).
And while we're at it, also remove the KVM_MEM_SLOTS_NUM definition from the powerpc-specific header since this gets defined in the generic kvm_host.h header anyway.

Paul.

#4 lore raw

Re: [PATCH 1/1] KVM: PPC: Increase memslots to 320

Quoted 8 lines · Paul Mackerras
Quoted 6 lines · Thomas Huth

Only using 32 memslots for KVM on powerpc is way too low, you can nowadays hit this limit quite fast by adding a couple of PCI devices and/or pluggable memory DIMMs to the guest.
x86 already increased the limit to 512 in total, to satisfy 256 pluggable DIMM slots, 3 private slots and 253 slots for other things like PCI devices. On powerpc, we only have 32 pluggable DIMMs in

Quoted 4 lines

I agree with increasing the limit. Is there a reason we have only 32 pluggable DIMMs in QEMU on powerpc, not more? Should we be increasing that limit too? If so, maybe we should increase the number of memory slots to 512?

Hmmmm ... the comment before the #define in QEMU reads:

/*
* This defines the maximum number of DIMM slots we can have for sPAPR
* guest. This is not defined by sPAPR but we are defining it to 32 slots
* based on default number of slots provided by PowerPC kernel. */
#define SPAPR_MAX_RAM_SLOTS 32

So as far as I can see, there's indeed a possibility that we'll increase this value once the kernel can handle more slots!

So I guess you're right and we should play save and use more slots right from the start. I'll send a new patch with 512 instead.

Quoted 4 lines
Quoted 1 line

QEMU, not 256, so we likely do not as much slots as on x86. Thus

"so we likely do not need as many slots as on x86" would be better English.

Oops, I'm sure that was my original intention ... anyway, thanks for pointing it out, it's always good to get some feedback as a non-native English speaker.

Thomas