qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu processes
@ 2019-06-12 14:30 Ryan Boyce
  2019-06-12 16:48 ` Alex Bennée
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Boyce @ 2019-06-12 14:30 UTC (permalink / raw)
  To: qemu-devel

Hi Stefan,

I am a big fan of your blog! In relation to your blog post,
http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html,
I have a question I am really hoping you can answer:

When I start a VM, I see that the qemu-kvm processes start and run as
"qemu-kvm..... -name "something1"...."
My issue, though, is I see multiple processes running as "qemu-kvm.....
-name "something1"...." and each of these processes has memory/cpu/disk
mapped to it.
Does qemu-kvm run VMs on a one-to-one VM-to-host process basis? Or does
each virtual cpu on the guest get its own process on the host?
For example, If I have a VM that has 4 virtual cpus, will I see 4 processes
(PIDs) on the host or should I see just see one for the VM itself.

Any help you can give would be GREATLY appreciated. Thank you!

Ryan

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

* Re: [Qemu-devel] qemu processes
  2019-06-12 14:30 [Qemu-devel] qemu processes Ryan Boyce
@ 2019-06-12 16:48 ` Alex Bennée
  2019-06-12 16:50   ` Ryan Boyce
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Bennée @ 2019-06-12 16:48 UTC (permalink / raw)
  To: Ryan Boyce; +Cc: QEMU Developers

You've actually contacted the development list but I can answer the question.

QEMU is multi-threaded so there will be a thread per KVM based vCPU
(and also for TCG based vCPUs where MTTCG is enabled). There will also
be a number of additional threads created including at least one for
the main monitor thread and potentially additional threads for
servicing IO requests. So expect to see $SMP + 1 + n threads for each
QEMU instance.

On Wed, 12 Jun 2019 at 16:32, Ryan Boyce <ryanpboyce12@gmail.com> wrote:
>
> Hi Stefan,
>
> I am a big fan of your blog! In relation to your blog post,
> http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html,
> I have a question I am really hoping you can answer:
>
> When I start a VM, I see that the qemu-kvm processes start and run as
> "qemu-kvm..... -name "something1"...."
> My issue, though, is I see multiple processes running as "qemu-kvm.....
> -name "something1"...." and each of these processes has memory/cpu/disk
> mapped to it.
> Does qemu-kvm run VMs on a one-to-one VM-to-host process basis? Or does
> each virtual cpu on the guest get its own process on the host?
> For example, If I have a VM that has 4 virtual cpus, will I see 4 processes
> (PIDs) on the host or should I see just see one for the VM itself.
>
> Any help you can give would be GREATLY appreciated. Thank you!
>
> Ryan



-- 
Alex Bennée
KVM/QEMU Hacker for Linaro


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

* Re: [Qemu-devel] qemu processes
  2019-06-12 16:48 ` Alex Bennée
@ 2019-06-12 16:50   ` Ryan Boyce
  2019-06-18 16:46     ` Ryan Boyce
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Boyce @ 2019-06-12 16:50 UTC (permalink / raw)
  To: Alex Bennée; +Cc: QEMU Developers

Thank you my friend!

On Wed, Jun 12, 2019 at 12:48 PM Alex Bennée <alex.bennee@linaro.org> wrote:

> You've actually contacted the development list but I can answer the
> question.
>
> QEMU is multi-threaded so there will be a thread per KVM based vCPU
> (and also for TCG based vCPUs where MTTCG is enabled). There will also
> be a number of additional threads created including at least one for
> the main monitor thread and potentially additional threads for
> servicing IO requests. So expect to see $SMP + 1 + n threads for each
> QEMU instance.
>
> On Wed, 12 Jun 2019 at 16:32, Ryan Boyce <ryanpboyce12@gmail.com> wrote:
> >
> > Hi Stefan,
> >
> > I am a big fan of your blog! In relation to your blog post,
> >
> http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html,
> > I have a question I am really hoping you can answer:
> >
> > When I start a VM, I see that the qemu-kvm processes start and run as
> > "qemu-kvm..... -name "something1"...."
> > My issue, though, is I see multiple processes running as "qemu-kvm.....
> > -name "something1"...." and each of these processes has memory/cpu/disk
> > mapped to it.
> > Does qemu-kvm run VMs on a one-to-one VM-to-host process basis? Or does
> > each virtual cpu on the guest get its own process on the host?
> > For example, If I have a VM that has 4 virtual cpus, will I see 4
> processes
> > (PIDs) on the host or should I see just see one for the VM itself.
> >
> > Any help you can give would be GREATLY appreciated. Thank you!
> >
> > Ryan
>
>
>
> --
> Alex Bennée
> KVM/QEMU Hacker for Linaro
>

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

* Re: [Qemu-devel] qemu processes
  2019-06-12 16:50   ` Ryan Boyce
@ 2019-06-18 16:46     ` Ryan Boyce
  2019-06-19 15:09       ` Alex Bennée
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Boyce @ 2019-06-18 16:46 UTC (permalink / raw)
  To: Alex Bennée; +Cc: QEMU Developers

Alex,

I have another KVM/qemu related CPU question. I am hoping you will be so
kind as to answer again. I have a Dell Poweredge T430 server running a
single Intel Xeon E5-2603 v3 CPU with 6 cores. I have 6 VMs running CentOS
7 via KVM. I am noticing some terrible host CPU performance when a VM runs
a simple process such as a recursive search on its file system. I see VM
CPU acting normally but the host CPU skyrockets to well over 100%. I have a
few ideas as to why this is but am hoping you might be able to point me in
the right direction. Thank you so much for your help!

Ryan

On Wed, Jun 12, 2019 at 12:50 PM Ryan Boyce <ryanpboyce12@gmail.com> wrote:

> Thank you my friend!
>
> On Wed, Jun 12, 2019 at 12:48 PM Alex Bennée <alex.bennee@linaro.org>
> wrote:
>
>> You've actually contacted the development list but I can answer the
>> question.
>>
>> QEMU is multi-threaded so there will be a thread per KVM based vCPU
>> (and also for TCG based vCPUs where MTTCG is enabled). There will also
>> be a number of additional threads created including at least one for
>> the main monitor thread and potentially additional threads for
>> servicing IO requests. So expect to see $SMP + 1 + n threads for each
>> QEMU instance.
>>
>> On Wed, 12 Jun 2019 at 16:32, Ryan Boyce <ryanpboyce12@gmail.com> wrote:
>> >
>> > Hi Stefan,
>> >
>> > I am a big fan of your blog! In relation to your blog post,
>> >
>> http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html
>> ,
>> > I have a question I am really hoping you can answer:
>> >
>> > When I start a VM, I see that the qemu-kvm processes start and run as
>> > "qemu-kvm..... -name "something1"...."
>> > My issue, though, is I see multiple processes running as "qemu-kvm.....
>> > -name "something1"...." and each of these processes has memory/cpu/disk
>> > mapped to it.
>> > Does qemu-kvm run VMs on a one-to-one VM-to-host process basis? Or does
>> > each virtual cpu on the guest get its own process on the host?
>> > For example, If I have a VM that has 4 virtual cpus, will I see 4
>> processes
>> > (PIDs) on the host or should I see just see one for the VM itself.
>> >
>> > Any help you can give would be GREATLY appreciated. Thank you!
>> >
>> > Ryan
>>
>>
>>
>> --
>> Alex Bennée
>> KVM/QEMU Hacker for Linaro
>>
>

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

* Re: [Qemu-devel] qemu processes
  2019-06-18 16:46     ` Ryan Boyce
@ 2019-06-19 15:09       ` Alex Bennée
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Bennée @ 2019-06-19 15:09 UTC (permalink / raw)
  To: Ryan Boyce; +Cc: QEMU Developers


Ryan Boyce <ryanpboyce12@gmail.com> writes:

> Alex,
>
> I have another KVM/qemu related CPU question. I am hoping you will be so
> kind as to answer again. I have a Dell Poweredge T430 server running a
> single Intel Xeon E5-2603 v3 CPU with 6 cores. I have 6 VMs running CentOS
> 7 via KVM. I am noticing some terrible host CPU performance when a VM runs
> a simple process such as a recursive search on its file system. I see VM
> CPU acting normally but the host CPU skyrockets to well over 100%. I have a
> few ideas as to why this is but am hoping you might be able to point me in
> the right direction. Thank you so much for your help!

A lot will depend on caching and how much of your guest file-system is
already in the host page cache. Otherwise you have a round-trip to make
to load the blocks into RAM.

However usually my first step is to run something like:

  perf top

And see where the host is spending its time and go from there.

>
> Ryan
>
> On Wed, Jun 12, 2019 at 12:50 PM Ryan Boyce <ryanpboyce12@gmail.com> wrote:
>
>> Thank you my friend!
>>
>> On Wed, Jun 12, 2019 at 12:48 PM Alex Bennée <alex.bennee@linaro.org>
>> wrote:
>>
>>> You've actually contacted the development list but I can answer the
>>> question.
>>>
>>> QEMU is multi-threaded so there will be a thread per KVM based vCPU
>>> (and also for TCG based vCPUs where MTTCG is enabled). There will also
>>> be a number of additional threads created including at least one for
>>> the main monitor thread and potentially additional threads for
>>> servicing IO requests. So expect to see $SMP + 1 + n threads for each
>>> QEMU instance.
>>>
>>> On Wed, 12 Jun 2019 at 16:32, Ryan Boyce <ryanpboyce12@gmail.com> wrote:
>>> >
>>> > Hi Stefan,
>>> >
>>> > I am a big fan of your blog! In relation to your blog post,
>>> >
>>> http://blog.vmsplice.net/2011/03/qemu-internals-big-picture-overview.html
>>> ,
>>> > I have a question I am really hoping you can answer:
>>> >
>>> > When I start a VM, I see that the qemu-kvm processes start and run as
>>> > "qemu-kvm..... -name "something1"...."
>>> > My issue, though, is I see multiple processes running as "qemu-kvm.....
>>> > -name "something1"...." and each of these processes has memory/cpu/disk
>>> > mapped to it.
>>> > Does qemu-kvm run VMs on a one-to-one VM-to-host process basis? Or does
>>> > each virtual cpu on the guest get its own process on the host?
>>> > For example, If I have a VM that has 4 virtual cpus, will I see 4
>>> processes
>>> > (PIDs) on the host or should I see just see one for the VM itself.
>>> >
>>> > Any help you can give would be GREATLY appreciated. Thank you!
>>> >
>>> > Ryan
>>>
>>>
>>>
>>> --
>>> Alex Bennée
>>> KVM/QEMU Hacker for Linaro
>>>
>>


--
Alex Bennée


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

end of thread, other threads:[~2019-06-19 15:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 14:30 [Qemu-devel] qemu processes Ryan Boyce
2019-06-12 16:48 ` Alex Bennée
2019-06-12 16:50   ` Ryan Boyce
2019-06-18 16:46     ` Ryan Boyce
2019-06-19 15:09       ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).