Skip to contentSkip to conversation

spapr.c: Update qemu's maxcpus for pseries machine.

PATCH In review Seeteena Thoufeek 3 participants 4 messages Dec 1, 2017 – Dec 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spapr.c: Update qemu's maxcpus for pseries machine.

Need to adjust the max cpus supported number from error message since it was conflicting with KVM's.

Steps to Reproduce:
1.boot up with
"-smp 64,maxcpus=102464,cores=8,threads=1,sockets=8"

qemu-kvm: Number of SMP CPUs requested (102464) exceeds max CPUs supported by machine 'pseries-rhel7.4.0alt' (1024)

2. On KVM machine it shows

boot up with
"-m 6G,maxmem=300G,slots=256 -smp 64,maxcpus=1024,cores=8,threads=1 ,sockets=128"

Number of hotpluggable cpus requested (1024) exceeds the maximum cpus
supported by KVM (240)

It seemed that 1024 was useless since KVM only support 240 so far. Hence,we need to adjust it to an reasonable value 240.

---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 9efddea..c753254 100644
@@ -3691,6 +3691,7 @@ static const TypeInfo spapr_machine_info = {
         if (latest) {                                                \
             mc->alias = "pseries";                                   \
             mc->is_default = 1;                                      \
+            mc->max_cpus = 240;                                      \
         }                                                            \
     }                                                                \
     static void spapr_machine_##suffix##_instance_init(Object *obj)  \
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 10 lines · On Fri, 1 Dec 2017 16:54:09 +0530 Seeteena Thoufeek…

Need to adjust the max cpus supported number from error message since it was conflicting with KVM's.

Steps to Reproduce:
1.boot up with
"-smp 64,maxcpus=102464,cores=8,threads=1,sockets=8"

qemu-kvm: Number of SMP CPUs requested (102464) exceeds max CPUs supported by machine 'pseries-rhel7.4.0alt' (1024)

The above error message was dumped by commit c0dd10991903 (authored by you apparently). Now it should be:

Invalid SMP CPUs 102464. The max CPUs supported by
machine 'pseries-rhel7.4.0alt' is 1024

Quoted 10 lines

2. On KVM machine it shows

boot up with
"-m 6G,maxmem=300G,slots=256 -smp 64,maxcpus=1024,cores=8,threads=1 ,sockets=128"

Number of hotpluggable cpus requested (1024) exceeds the maximum cpus
supported by KVM (240)

It seemed that 1024 was useless since KVM only support 240 so far.

This is the limit imposed by KVM, which is basically the number of CPUs on the host system. On some bigger systems, it can be up to 1536 AFAIK.

The machine limit is a different beast and someone could legitimately run a fully emulated guest (TCG) with 1024 CPUs.

Hence it really doesn't make sense to hardcode the KVM value from your system into QEMU.

Quoted 12 lines

Hence,we need to adjust it to an reasonable value 240.

---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +0 -0
index 9efddea..c753254 100644

hw/ppc/spapr.c static const TypeInfo spapr_machine_info = { · line 3694

Quoted 4 lines
hw/ppc/spapr.c +1 -0
@@ -3691,6 +3691,7 @@ static const TypeInfo spapr_machine_info = {
         if (latest) {                                                \
             mc->alias = "pseries";                                   \
             mc->is_default = 1;                                      \
+            mc->max_cpus = 240;                                      \

BTW, this isn't the right place: the limit is set in spapr_machine_class_init()

Quoted 3 lines
hw/ppc/spapr.c +0 -0
         }                                                            \
     }                                                                \
     static void spapr_machine_##suffix##_instance_init(Object *obj)  \
#2 lore raw
In reply to Seeteena Thoufeek
Quoted 16 lines · Seeteena Thoufeek

Need to adjust the max cpus supported number from error message since it was conflicting with KVM's.

Steps to Reproduce:
1.boot up with
"-smp 64,maxcpus=102464,cores=8,threads=1,sockets=8"

qemu-kvm: Number of SMP CPUs requested (102464) exceeds max CPUs supported by machine 'pseries-rhel7.4.0alt' (1024)

2. On KVM machine it shows

boot up with
"-m 6G,maxmem=300G,slots=256 -smp 64,maxcpus=1024,cores=8,threads=1 ,sockets=128"

Quoted 7 lines

Number of hotpluggable cpus requested (1024) exceeds the maximum cpus
supported by KVM (240)

It seemed that 1024 was useless since KVM only support 240 so far. Hence,we need to adjust it to an reasonable value 240.

This has been written without adequate thought and investigation.

First, in upstream code there's nothing wrong with having different limits in qemu and kernel - the can both vary depending on various factors. Secondly, the 240 limit doesn't come from the kernel upstream - only in RHEL.

Third, it doesn't even come from the kernel in RHEL - the downstream qemu lies about the kernel limit.

I'm in the process of fixing this correctly, I expect to have something on Monday.

Quoted 16 lines
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 9efddea..c753254 100644
@@ -3691,6 +3691,7 @@ static const TypeInfo spapr_machine_info = {
         if (latest) {                                                \
             mc->alias = "pseries";                                   \
             mc->is_default = 1;                                      \
+            mc->max_cpus = 240;                                      \
         }                                                            \
     }                                                                \
     static void spapr_machine_##suffix##_instance_init(Object *obj)  \
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
author
#3 lore raw

Thanks David for the explanation.

I thought the changes been into upstream code for pseries to limit

maxcpus to 240 instead of 1024.

Quoted 53 lines · David Gibson
Quoted 16 lines · Seeteena Thoufeek

Need to adjust the max cpus supported number from error message since it was conflicting with KVM's.

Steps to Reproduce:
1.boot up with
"-smp 64,maxcpus=102464,cores=8,threads=1,sockets=8"

qemu-kvm: Number of SMP CPUs requested (102464) exceeds max CPUs supported by machine 'pseries-rhel7.4.0alt' (1024)

2. On KVM machine it shows

boot up with
"-m 6G,maxmem=300G,slots=256 -smp 64,maxcpus=1024,cores=8,threads=1 ,sockets=128"

Quoted 7 lines

Number of hotpluggable cpus requested (1024) exceeds the maximum cpus
supported by KVM (240)

It seemed that 1024 was useless since KVM only support 240 so far. Hence,we need to adjust it to an reasonable value 240.

This has been written without adequate thought and investigation.

First, in upstream code there's nothing wrong with having different limits in qemu and kernel - the can both vary depending on various factors. Secondly, the 240 limit doesn't come from the kernel upstream - only in RHEL.

Third, it doesn't even come from the kernel in RHEL - the downstream qemu lies about the kernel limit.

I'm in the process of fixing this correctly, I expect to have something on Monday.

Quoted 16 lines
---
  hw/ppc/spapr.c | 1 +
  1 file changed, 1 insertion(+)
hw/ppc/spapr.c +1 -0
index 9efddea..c753254 100644
@@ -3691,6 +3691,7 @@ static const TypeInfo spapr_machine_info = {
          if (latest) {                                                \
              mc->alias = "pseries";                                   \
              mc->is_default = 1;                                      \
+            mc->max_cpus = 240;                                      \
          }                                                            \
      }                                                                \
      static void spapr_machine_##suffix##_instance_init(Object *obj)  \