154 lines
5.0 KiB
Diff
154 lines
5.0 KiB
Diff
From b64599f8f72d89ac75557608f1890abb8effb88b Mon Sep 17 00:00:00 2001
|
|
From: Andrew Jones <drjones@redhat.com>
|
|
Date: Tue, 21 Jan 2014 10:46:52 +0100
|
|
Subject: globally limit the maximum number of CPUs
|
|
|
|
We now globally limit the number of VCPUs.
|
|
Especially, there is no way one can specify more than
|
|
max_cpus VCPUs for a VM.
|
|
|
|
This allows us the restore the ppc max_cpus limitation to the upstream
|
|
default and minimize the ppc hack in kvm-all.c.
|
|
|
|
Signed-off-by: David Hildenbrand <david@redhat.com>
|
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
Signed-off-by: Danilo Cesar Lemes de Paula <ddepaula@redhat.com>
|
|
|
|
Rebase notes (2.11.0):
|
|
- Removed CONFIG_RHV reference
|
|
- Update commit log
|
|
|
|
Merged patches (2.11.0):
|
|
- 92fef14623 redhat: remove manual max_cpus limitations for ppc
|
|
- bb722e9eff redhat: globally limit the maximum number of CPUs
|
|
- fdeef3c1c7 RHEL: Set vcpus hard limit to 240 for Power
|
|
- 0584216921 Match POWER max cpus to x86
|
|
|
|
Signed-off-by: Andrew Jones <drjones@redhat.com>
|
|
(cherry picked from commit a4ceb63bdc5cbac19f5f633ec761b9de0dedb55e)
|
|
(cherry picked from commit a1f26d85171b4d554225150053700e93ba6eba10)
|
|
|
|
redhat: globally limit the maximum number of CPUs
|
|
|
|
RH-Author: David Hildenbrand <david@redhat.com>
|
|
Message-id: <20180109103253.24517-2-david@redhat.com>
|
|
Patchwork-id: 78531
|
|
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH v2 1/2] redhat: globally limit the maximum number of CPUs
|
|
Bugzilla: 1527449
|
|
RH-Acked-by: David Gibson <dgibson@redhat.com>
|
|
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
|
Upstream-status: n/a
|
|
|
|
For RHEL, we support 240, for RHV up to 384 VCPUs. Let's limit this
|
|
globally instead of fixing up all machines. This way, we can easily
|
|
change (increase) the product specific levels later.
|
|
|
|
Signed-off-by: David Hildenbrand <david@redhat.com>
|
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
|
redhat: remove manual max_cpus limitations for ppc
|
|
|
|
RH-Author: David Hildenbrand <david@redhat.com>
|
|
Message-id: <20180109103253.24517-3-david@redhat.com>
|
|
Patchwork-id: 78532
|
|
O-Subject: [RHEL-7.5 qemu-kvm-ma PATCH v2 2/2] redhat: remove manual max_cpus limitations for ppc
|
|
Bugzilla: 1527449
|
|
RH-Acked-by: David Gibson <dgibson@redhat.com>
|
|
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
|
Upstream-status: n/a
|
|
|
|
RH-Author: Andrew Jones <drjones@redhat.com>
|
|
Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com>
|
|
Patchwork-id: 56862
|
|
O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count
|
|
Bugzilla: 998708
|
|
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
|
|
|
|
The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead
|
|
of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error.
|
|
|
|
This commit matches the limit to current KVM_CAP_NR_VCPUS value.
|
|
|
|
Conflicts:
|
|
vl.c
|
|
---
|
|
accel/kvm/kvm-all.c | 12 ++++++++++++
|
|
vl.c | 18 ++++++++++++++++++
|
|
2 files changed, 30 insertions(+)
|
|
|
|
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
|
|
index 4880a05..a8f5d47 100644
|
|
--- a/accel/kvm/kvm-all.c
|
|
+++ b/accel/kvm/kvm-all.c
|
|
@@ -1627,6 +1627,18 @@ static int kvm_init(MachineState *ms)
|
|
soft_vcpus_limit = kvm_recommended_vcpus(s);
|
|
hard_vcpus_limit = kvm_max_vcpus(s);
|
|
|
|
+#ifdef HOST_PPC64
|
|
+ /*
|
|
+ * On POWER, the kernel advertises a soft limit based on the
|
|
+ * number of CPU threads on the host. We want to allow exceeding
|
|
+ * this for testing purposes, so we don't want to set hard limit
|
|
+ * to soft limit as on x86.
|
|
+ */
|
|
+#else
|
|
+ /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */
|
|
+ hard_vcpus_limit = soft_vcpus_limit;
|
|
+#endif
|
|
+
|
|
while (nc->name) {
|
|
if (nc->num > soft_vcpus_limit) {
|
|
warn_report("Number of %s cpus requested (%d) exceeds "
|
|
diff --git a/vl.c b/vl.c
|
|
index 74b32c4..0a9bdc2 100644
|
|
--- a/vl.c
|
|
+++ b/vl.c
|
|
@@ -134,6 +134,8 @@ int main(int argc, char **argv)
|
|
|
|
#define MAX_VIRTIO_CONSOLES 1
|
|
|
|
+#define RHEL_MAX_CPUS 384
|
|
+
|
|
static const char *data_dir[16];
|
|
static int data_dir_idx;
|
|
const char *bios_name = NULL;
|
|
@@ -1463,6 +1465,20 @@ MachineClass *find_default_machine(void)
|
|
return mc;
|
|
}
|
|
|
|
+/* Maximum number of CPUs limited for Red Hat Enterprise Linux */
|
|
+static void limit_max_cpus_in_machines(void)
|
|
+{
|
|
+ GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
|
|
+
|
|
+ for (el = machines; el; el = el->next) {
|
|
+ MachineClass *mc = el->data;
|
|
+
|
|
+ if (mc->max_cpus > RHEL_MAX_CPUS) {
|
|
+ mc->max_cpus = RHEL_MAX_CPUS;
|
|
+ }
|
|
+ }
|
|
+}
|
|
+
|
|
MachineInfoList *qmp_query_machines(Error **errp)
|
|
{
|
|
GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
|
|
@@ -4021,6 +4037,8 @@ int main(int argc, char **argv, char **envp)
|
|
"mutually exclusive");
|
|
exit(EXIT_FAILURE);
|
|
}
|
|
+ /* Maximum number of CPUs limited for Red Hat Enterprise Linux */
|
|
+ limit_max_cpus_in_machines();
|
|
|
|
configure_rtc(qemu_find_opts_singleton("rtc"));
|
|
|
|
--
|
|
1.8.3.1
|
|
|