LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 07-29-2012, 10:11 PM   #1
MeNok
LQ Newbie
 
Registered: Aug 2011
Posts: 22

Rep: Reputation: Disabled
Smile a guestOS process occupies VCPU at any given time?


Hi there,

Recently i`ve been studying something about hardware-supported virtualization.

I read about 3 states of host cpu ,thus the most common userspace,kernelspace and A New Guest State.And as i can see from the ps command,there is a process for the vm i started,and some 'sub'-threads for each cpu owned by the virtual machine.Also i noticed when the vm runs some io related program,some more threads will be created on the host,which i guess might be the responses of qemu for hardware emulation.

So here comes my question:For any certain time(time in guest state,not the other two),does a vcpu thread represent a guestOS process running(i mean 'occupy' and 'exclusively')?just the same as a physical cpu,for any given time in userspace,a user process is running on it.
This may sound a little stupid,I just want to figure it out for further research.

To make this question simple:
is the vcpu thread which runs on host machine associated with some guestOS process at any given time?

To further simplify it:
is it right when i say the guestOS processes are actually running on the host CPU directly and scheduled as ordinary host-processes?the difference between the two kinds of process being what we called virtualization?

Maybe i need another threads to solve some questions about guestOS process switching,but before that,hope you guys can help me with this one.

sincerely
MeNok
 
Old 07-30-2012, 01:25 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 836

Rep: Reputation: 91
If you're talking about kvm, then a vcpu thread represents a vcpu. At any given time it can be idle, or executing an execution slot for an in-guest process, same as a physical cpu can either be idle, or be executing an execution slot for the host
 
Old 07-30-2012, 04:23 AM   #3
MeNok
LQ Newbie
 
Registered: Aug 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by dyasny View Post
If you're talking about kvm, then a vcpu thread represents a vcpu. At any given time it can be idle, or executing an execution slot for an in-guest process, same as a physical cpu can either be idle, or be executing an execution slot for the host
dyasny,thank you for your reply~
I should have make it clear that i was talking about kvm this time.And i myself have noticed that it is quite another situation in xen---there`ll be no extra threads spawned when i/o calls issued.I`m told xen simply uses the mechanism of qemu rather than the qemu itsefl(though i dunno what this mechanism refers to),this might explain why kvm and xen have difference behaviors.
 
Old 07-31-2012, 02:23 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 836

Rep: Reputation: 91
This is because Xen's vCPU processes are not in the Dom-0. There are a couple of good diagrams at the bottom of this article: http://chucknology.com/2012/02/02/kv...ux-xen-is-not/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] vCPU change in VM is not dedected in RHEL 4.8 getraj.12@gmail.com Red Hat 4 10-31-2012 04:18 PM
/proc occupies all the space in / Gil@LQ Linux - General 3 05-15-2012 01:42 AM
[SOLVED] How to save the pid of a process at the time of process startup jhonnappier2007 Linux - Newbie 13 11-20-2011 11:54 PM
xm vcpu-set domain-name vcpus-count karthickk02 Linux - Virtualization and Cloud 2 03-01-2011 06:35 AM
My harddisk usage is 91% but I cannot figure out what occupies so much space... Niceman2005 Linux - General 6 11-01-2005 02:02 AM


All times are GMT -5. The time now is 07:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration