public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* smp option of qemu-kvm
@ 2012-04-05 18:28 Steven
  2012-04-05 18:40 ` Daniel P. Berrange
  0 siblings, 1 reply; 5+ messages in thread
From: Steven @ 2012-04-05 18:28 UTC (permalink / raw)
  To: kvm

Hi,
I started a kvm VM by adding -smp 2 option. From inside the guest, I
can see that /proc/cpuinfo outputs 2 cores.
However, in the host, I only observe one qemu-kvm process for that VM.
Does that mean this VM is actually running on one core?
If so, how to make a VM to run on 2 or more cores? Thanks.

-ha

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

* Re: smp option of qemu-kvm
  2012-04-05 18:28 smp option of qemu-kvm Steven
@ 2012-04-05 18:40 ` Daniel P. Berrange
  2012-04-05 18:52   ` Steven
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel P. Berrange @ 2012-04-05 18:40 UTC (permalink / raw)
  To: Steven; +Cc: kvm

On Thu, Apr 05, 2012 at 02:28:51PM -0400, Steven wrote:
> Hi,
> I started a kvm VM by adding -smp 2 option. From inside the guest, I
> can see that /proc/cpuinfo outputs 2 cores.
> However, in the host, I only observe one qemu-kvm process for that VM.
> Does that mean this VM is actually running on one core?
> If so, how to make a VM to run on 2 or more cores? Thanks.

Each VCPU in KVM corresponds to a separate thread in the process. The
'ps' command only ever shows the thread leader by default - so you
don't see those VCPU threads in the process list. eg ps -eLf to
see all threads

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: smp option of qemu-kvm
  2012-04-05 18:40 ` Daniel P. Berrange
@ 2012-04-05 18:52   ` Steven
  2012-04-05 19:03     ` Daniel P. Berrange
  2012-04-06 15:28     ` Stuart Yoder
  0 siblings, 2 replies; 5+ messages in thread
From: Steven @ 2012-04-05 18:52 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: kvm

Hi, Daniel,
Thanks for your quick response. However, the ps -eLf show 4 threads
for the VM and I checked 4 threads have the same tgid.
But the VM I created is with -smp 2 option. Could you explain this? Thanks.


On Thu, Apr 5, 2012 at 2:40 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
> On Thu, Apr 05, 2012 at 02:28:51PM -0400, Steven wrote:
>> Hi,
>> I started a kvm VM by adding -smp 2 option. From inside the guest, I
>> can see that /proc/cpuinfo outputs 2 cores.
>> However, in the host, I only observe one qemu-kvm process for that VM.
>> Does that mean this VM is actually running on one core?
>> If so, how to make a VM to run on 2 or more cores? Thanks.
>
> Each VCPU in KVM corresponds to a separate thread in the process. The
> 'ps' command only ever shows the thread leader by default - so you
> don't see those VCPU threads in the process list. eg ps -eLf to
> see all threads
>
> Daniel
> --
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: smp option of qemu-kvm
  2012-04-05 18:52   ` Steven
@ 2012-04-05 19:03     ` Daniel P. Berrange
  2012-04-06 15:28     ` Stuart Yoder
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel P. Berrange @ 2012-04-05 19:03 UTC (permalink / raw)
  To: Steven; +Cc: kvm

On Thu, Apr 05, 2012 at 02:52:40PM -0400, Steven wrote:
> Hi, Daniel,
> Thanks for your quick response. However, the ps -eLf show 4 threads
> for the VM and I checked 4 threads have the same tgid.
> But the VM I created is with -smp 2 option. Could you explain this? Thanks.

As well as the vCPU threads, QEMU creates other threads as needed, typically
for I/O - indeed the count of threads may vary over time.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: smp option of qemu-kvm
  2012-04-05 18:52   ` Steven
  2012-04-05 19:03     ` Daniel P. Berrange
@ 2012-04-06 15:28     ` Stuart Yoder
  1 sibling, 0 replies; 5+ messages in thread
From: Stuart Yoder @ 2012-04-06 15:28 UTC (permalink / raw)
  To: Steven; +Cc: Daniel P. Berrange, kvm

On Thu, Apr 5, 2012 at 1:52 PM, Steven <wangwangkang@gmail.com> wrote:
> Hi, Daniel,
> Thanks for your quick response. However, the ps -eLf show 4 threads
> for the VM and I checked 4 threads have the same tgid.
> But the VM I created is with -smp 2 option. Could you explain this? Thanks.

"info cpus" in the QEMU monitor shell willshow you which thread ID
corresponds to each vpu.

Stuart

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

end of thread, other threads:[~2012-04-06 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 18:28 smp option of qemu-kvm Steven
2012-04-05 18:40 ` Daniel P. Berrange
2012-04-05 18:52   ` Steven
2012-04-05 19:03     ` Daniel P. Berrange
2012-04-06 15:28     ` Stuart Yoder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox