mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: gleb@redhat.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS
Date: Sat, 14 Sep 2013 14:18:49 +0200	[thread overview]
Message-ID: <1379161129-28393-1-git-send-email-drjones@redhat.com> (raw)

Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 arch/x86/include/asm/kvm_host.h |  5 +++--
 arch/x86/kvm/Kconfig            | 10 ++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index c76ff74a98f2e..e7e9b523a8f7e 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -31,8 +31,9 @@
 #include <asm/msr-index.h>
 #include <asm/asm.h>
 
-#define KVM_MAX_VCPUS 255
-#define KVM_SOFT_MAX_VCPUS 160
+#define KVM_MAX_VCPUS CONFIG_KVM_MAX_VCPUS
+#define KVM_SOFT_MAX_VCPUS min(160, KVM_MAX_VCPUS)
+
 #define KVM_USER_MEM_SLOTS 125
 /* memory slots that are not exposed to userspace */
 #define KVM_PRIVATE_MEM_SLOTS 3
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index a47a3e54b964b..e9532c33527ee 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -52,6 +52,16 @@ config KVM
 
 	  If unsure, say N.
 
+config KVM_MAX_VCPUS
+	int "Number maximum supported virtual CPUs per VM"
+	depends on KVM
+	default 255
+	help
+	  Static number of max supported virtual CPUs per VM.
+
+	  Set to a lower number to save some resources. Set to a higher
+	  number to test scalability.
+
 config KVM_INTEL
 	tristate "KVM for Intel processors support"
 	depends on KVM
-- 
1.8.1.4


             reply	other threads:[~2013-09-14 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-14 12:18 Andrew Jones [this message]
2013-09-15  9:08 ` Gleb Natapov
2013-09-16  8:28   ` Andrew Jones
2013-09-16  8:47     ` Gleb Natapov
2013-09-16 12:03       ` Andrew Jones
2013-09-16 14:16         ` Gleb Natapov
2013-09-16 15:36           ` Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379161129-28393-1-git-send-email-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®