All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
@ 2013-09-11 13:02 Anup Patel
  2013-09-13 12:46 ` Marc Zyngier
  0 siblings, 1 reply; 6+ messages in thread
From: Anup Patel @ 2013-09-11 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

Current max VCPUs per-Guest is set to 4 which is preventing
us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
X-Gene Storm SOC) with 8 Host CPUs.

The correct value of max VCPUs per-Guest should be same as
the max CPUs supported by GICv2 which is 8 hence this patch
increases KVM_MAX_VCPUS to 8.

Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
---
 arch/arm64/include/asm/kvm_host.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 0859a4d..60ef29e 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -26,7 +26,7 @@
 #include <asm/kvm_asm.h>
 #include <asm/kvm_mmio.h>
 
-#define KVM_MAX_VCPUS 4
+#define KVM_MAX_VCPUS 8
 #define KVM_USER_MEM_SLOTS 32
 #define KVM_PRIVATE_MEM_SLOTS 4
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
-- 
1.7.9.5

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

* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
  2013-09-11 13:02 [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8 Anup Patel
@ 2013-09-13 12:46 ` Marc Zyngier
  2013-09-14  8:51   ` Andrew Jones
  2013-09-14 11:58   ` Andrew Jones
  0 siblings, 2 replies; 6+ messages in thread
From: Marc Zyngier @ 2013-09-13 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/09/13 14:02, Anup Patel wrote:
> Current max VCPUs per-Guest is set to 4 which is preventing
> us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
> X-Gene Storm SOC) with 8 Host CPUs.
> 
> The correct value of max VCPUs per-Guest should be same as
> the max CPUs supported by GICv2 which is 8 hence this patch
> increases KVM_MAX_VCPUS to 8.

If anything, please make it configurable just like we have on 32bit. No
reason to impose the extra overhead on everyone.

Thanks,

	M.

> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> ---
>  arch/arm64/include/asm/kvm_host.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index 0859a4d..60ef29e 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -26,7 +26,7 @@
>  #include <asm/kvm_asm.h>
>  #include <asm/kvm_mmio.h>
>  
> -#define KVM_MAX_VCPUS 4
> +#define KVM_MAX_VCPUS 8
>  #define KVM_USER_MEM_SLOTS 32
>  #define KVM_PRIVATE_MEM_SLOTS 4
>  #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
> 


-- 
Jazz is not dead. It just smells funny...

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

* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
  2013-09-13 12:46 ` Marc Zyngier
@ 2013-09-14  8:51   ` Andrew Jones
  2013-09-14 11:58   ` Andrew Jones
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2013-09-14  8:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 13, 2013 at 01:46:59PM +0100, Marc Zyngier wrote:
> On 11/09/13 14:02, Anup Patel wrote:
> > Current max VCPUs per-Guest is set to 4 which is preventing
> > us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
> > X-Gene Storm SOC) with 8 Host CPUs.
> > 
> > The correct value of max VCPUs per-Guest should be same as
> > the max CPUs supported by GICv2 which is 8 hence this patch
> > increases KVM_MAX_VCPUS to 8.
> 
> If anything, please make it configurable just like we have on 32bit. No
> reason to impose the extra overhead on everyone.

I have a couple patches I've been meaning to post, one of which does
this. I'll get them posted now.

drew

> 
> Thanks,
> 
> 	M.
> 
> > Signed-off-by: Anup Patel <anup.patel@linaro.org>
> > Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> > ---
> >  arch/arm64/include/asm/kvm_host.h |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> > index 0859a4d..60ef29e 100644
> > --- a/arch/arm64/include/asm/kvm_host.h
> > +++ b/arch/arm64/include/asm/kvm_host.h
> > @@ -26,7 +26,7 @@
> >  #include <asm/kvm_asm.h>
> >  #include <asm/kvm_mmio.h>
> >  
> > -#define KVM_MAX_VCPUS 4
> > +#define KVM_MAX_VCPUS 8
> >  #define KVM_USER_MEM_SLOTS 32
> >  #define KVM_PRIVATE_MEM_SLOTS 4
> >  #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
> > 
> 
> 
> -- 
> Jazz is not dead. It just smells funny...
> 
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm at lists.cs.columbia.edu
> https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

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

* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
  2013-09-13 12:46 ` Marc Zyngier
  2013-09-14  8:51   ` Andrew Jones
@ 2013-09-14 11:58   ` Andrew Jones
  2013-09-14 12:13     ` Marc Zyngier
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Jones @ 2013-09-14 11:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 13, 2013 at 01:46:59PM +0100, Marc Zyngier wrote:
> On 11/09/13 14:02, Anup Patel wrote:
> > Current max VCPUs per-Guest is set to 4 which is preventing
> > us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
> > X-Gene Storm SOC) with 8 Host CPUs.
> > 
> > The correct value of max VCPUs per-Guest should be same as
> > the max CPUs supported by GICv2 which is 8 hence this patch
> > increases KVM_MAX_VCPUS to 8.
> 
> If anything, please make it configurable just like we have on 32bit. No
> reason to impose the extra overhead on everyone.

What type of overhead are we talking about? Memory, right? as
kvm_for_each_vcpu is almost always used when iterating. But Anup says in
his v2 of this patch "can make things slower". If it's memory, then is so
much consumed by each vcpu that we shouldn't always set KVM_MAX_VCPUS
to at least the highest number that current hardware supports? Particularly
for aarch64 I think we should always be considering multi-platform with the
kernel configs.

drew

> 
> Thanks,
> 
> 	M.
> 
> > Signed-off-by: Anup Patel <anup.patel@linaro.org>
> > Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> > ---
> >  arch/arm64/include/asm/kvm_host.h |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> > index 0859a4d..60ef29e 100644
> > --- a/arch/arm64/include/asm/kvm_host.h
> > +++ b/arch/arm64/include/asm/kvm_host.h
> > @@ -26,7 +26,7 @@
> >  #include <asm/kvm_asm.h>
> >  #include <asm/kvm_mmio.h>
> >  
> > -#define KVM_MAX_VCPUS 4
> > +#define KVM_MAX_VCPUS 8
> >  #define KVM_USER_MEM_SLOTS 32
> >  #define KVM_PRIVATE_MEM_SLOTS 4
> >  #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
> > 
> 
> 
> -- 
> Jazz is not dead. It just smells funny...
> 
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm at lists.cs.columbia.edu
> https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

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

* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
  2013-09-14 11:58   ` Andrew Jones
@ 2013-09-14 12:13     ` Marc Zyngier
  2013-09-14 12:36       ` Andrew Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2013-09-14 12:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 2013-09-14 12:58, Andrew Jones wrote:
> On Fri, Sep 13, 2013 at 01:46:59PM +0100, Marc Zyngier wrote:
>> On 11/09/13 14:02, Anup Patel wrote:
>> > Current max VCPUs per-Guest is set to 4 which is preventing
>> > us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
>> > X-Gene Storm SOC) with 8 Host CPUs.
>> >
>> > The correct value of max VCPUs per-Guest should be same as
>> > the max CPUs supported by GICv2 which is 8 hence this patch
>> > increases KVM_MAX_VCPUS to 8.
>>
>> If anything, please make it configurable just like we have on 32bit. 
>> No
>> reason to impose the extra overhead on everyone.
>
> What type of overhead are we talking about? Memory, right? as

Memory indeed.

> kvm_for_each_vcpu is almost always used when iterating. But Anup says 
> in
> his v2 of this patch "can make things slower". If it's memory, then 
> is so
> much consumed by each vcpu that we shouldn't always set KVM_MAX_VCPUS

Not only. See how the GIC emulation also has per-VCPU data, and this 
results in potentially huge data structures. I have plans to address 
this in the future though.

> to at least the highest number that current hardware supports? 
> Particularly
> for aarch64 I think we should always be considering multi-platform 
> with the
> kernel configs.

What do you mean by multiplatform? This constant has nothing to do with 
being multiplatform, and the initial commit message was quite misleading 
in this respect. You can perfectly have 8 VCPUs on a single CPU host, 
and nothing so far impacts multiplatform.

The limit of 8 VCPUs has to do with a GICv2 limitation, which we 
emulate for the guest. Once we'll have GICv3 support in the kernel, this 
limit will be lifted.

         M.
-- 
Fast, cheap, reliable. Pick two.

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

* [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8
  2013-09-14 12:13     ` Marc Zyngier
@ 2013-09-14 12:36       ` Andrew Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Jones @ 2013-09-14 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Sep 14, 2013 at 01:13:59PM +0100, Marc Zyngier wrote:
> On 2013-09-14 12:58, Andrew Jones wrote:
> >On Fri, Sep 13, 2013 at 01:46:59PM +0100, Marc Zyngier wrote:
> >>On 11/09/13 14:02, Anup Patel wrote:
> >>> Current max VCPUs per-Guest is set to 4 which is preventing
> >>> us from creating a Guest (or VM) with 8 VCPUs on Host (e.g.
> >>> X-Gene Storm SOC) with 8 Host CPUs.
> >>>
> >>> The correct value of max VCPUs per-Guest should be same as
> >>> the max CPUs supported by GICv2 which is 8 hence this patch
> >>> increases KVM_MAX_VCPUS to 8.
> >>
> >>If anything, please make it configurable just like we have on
> >>32bit. No
> >>reason to impose the extra overhead on everyone.
> >
> >What type of overhead are we talking about? Memory, right? as
> 
> Memory indeed.
> 
> >kvm_for_each_vcpu is almost always used when iterating. But Anup
> >says in
> >his v2 of this patch "can make things slower". If it's memory,
> >then is so
> >much consumed by each vcpu that we shouldn't always set KVM_MAX_VCPUS
> 
> Not only. See how the GIC emulation also has per-VCPU data, and this
> results in potentially huge data structures. I have plans to address
> this in the future though.
> 
> >to at least the highest number that current hardware supports?
> >Particularly
> >for aarch64 I think we should always be considering multi-platform
> >with the
> >kernel configs.
> 
> What do you mean by multiplatform? This constant has nothing to do
> with being multiplatform, and the initial commit message was quite
> misleading in this respect. You can perfectly have 8 VCPUs on a
> single CPU host, and nothing so far impacts multiplatform.

I meant compile the kernel once, but still have it useful on multiple
hosts (some with 4 cpus, some with 8...). Of course with config option
that's still possible, just compile with CONFIG_KVM_MAX_VCPUS=8. So I
guess this is really more of a debate about what the default should be.
Considering the GIC code may be a bit of an over-consumer at the moment
and 8-cpu hosts may not be that widely deployed, then maybe 4 is the
better default right now?

drew

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

end of thread, other threads:[~2013-09-14 12:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 13:02 [PATCH] arm64: KVM: Increase max VCPUs per-Guest to 8 Anup Patel
2013-09-13 12:46 ` Marc Zyngier
2013-09-14  8:51   ` Andrew Jones
2013-09-14 11:58   ` Andrew Jones
2013-09-14 12:13     ` Marc Zyngier
2013-09-14 12:36       ` Andrew Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.