public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jes Sorensen <jes.sorensen@gmail.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
	Gleb Natapov <gleb@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [patch] qemu-kvm introduce -maxcpus argument
Date: Sun, 21 Jun 2009 15:53:05 +0300	[thread overview]
Message-ID: <4A3E2D31.6020101@redhat.com> (raw)
In-Reply-To: <4A3B9F4D.3000907@gmail.com>

On 06/19/2009 05:23 PM, Jes Sorensen wrote:
>
>> libvirt currently does
>>
>>      fd = open("/dev/kvm")
>>      r = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS);
>>
>> to figure out what the maximum allowed vCPUs will be for KVM,
>> and currently it is returning 16 IIRC.
>
> Interesting, this will need to be addressed as well. I have plans to
> introduce a mechanism telling the kernel where the limit will be, in
> order to allow it to allocate data structures in a reasonable manner.

I prefer to have the kernel adjust dynamically.  The vcpu array wants 8 
bytes per vcpu, so for 256 vcpus we're still a very reasonable 2K.  For 
(say) 4K vcpus, we'll need to reallocate the array dynamically, for 
which rcu will be perfect or better.

>> This implies the limit (for x86 pc machine at least) is now 255. Is that
>> the correct interpretation on my part ?
>
> Actually the 255 limit is tied to ACPI. Once we support ACPI 3.0 and
> x2apic, it will get much worse. Be afraid, be very afraid :-) To be
> honest, that is going to be a while before we get to that, but I hope
> to get to it eventually.
>
> I strongly recommend you try not to impose static limits within libvirt
> for the number of vCPUs.
>
> I guess it will become a tricky issue who is telling who what the limit
> is. Ideally I would like to see the kernel limit becoming unlimited and
> the restrictions being set by userland.

The kernel needs some kind of limit to avoid resource exhaustion.  Could 
be set quite high.  Beyond that there should be additional setup.

Note for 4K vcpus you'll need to increase the maximum opened files 
opened by a process, threads, etc.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2009-06-21 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 13:59 [patch] qemu-kvm introduce -maxcpus argument Jes Sorensen
2009-06-19 14:15 ` Daniel P. Berrange
2009-06-19 14:23   ` Jes Sorensen
2009-06-21 12:53     ` Avi Kivity [this message]
2009-06-19 15:24 ` Amit Shah
2009-06-22  7:11   ` Jes Sorensen
2009-06-21 12:54 ` Avi Kivity

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=4A3E2D31.6020101@redhat.com \
    --to=avi@redhat.com \
    --cc=berrange@redhat.com \
    --cc=gleb@redhat.com \
    --cc=jes.sorensen@gmail.com \
    --cc=kvm@vger.kernel.org \
    /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