[vbox-dev] About Virtual Box VM Scheduling mechanism

Suk Kyu Lee sklee25 at korea.ac.kr
Mon Jul 5 00:17:57 PDT 2010


I'm sorry if you received this email twice. Somehow the email was rejected.
Thank you.

Here is the original context of the email:

Thank you very much for your reply.

Maybe I have misunderstood the context of the email.
But I was wondering within the VMM, if there is any scheduling mechanism that might coordinate the work of each EMT that belongs to the VM. For example, EMT1 controls the CPU and while EMT1 is working, EMT2 is sleeping and etc.

Maybe my knowledge is not sufficient, but what do you mean by the host OS schedules the EMTs? Is there any mechanism that coordinates the EMTs within the host machine?

Likewise, within the Xen, I found out that there is a "Credit" Scheduler where it coordinates the CPU/IO resource amongst the VMs within the Xen VMM.

Because when I was looking over the VirtualBox code, I couldn't find the code that coordinates the EMT threads. I even disabled the HALT/Yield function within the VMM.cpp but it looks like there hasn't been any effect with/without these functions.

Again, thank you for your reply.
Hope you have a wonderful day!
Thank you.

Suk Kyu Lee

-----Original Message-----
From: Nikolay.Igotti at Sun.COM [mailto:Nikolay.Igotti at Sun.COM]
Sent: Monday, July 05, 2010 3:49 PM
To: Christian Pötzsch
Cc: VirtualBox developer's list; Suk Kyu Lee
Subject: Re: [vbox-dev] About Virtual Box VM Scheduling mechanism


Chris is correct that VM mostly executed in regular OS thread (called EMT - emulation thread), things gets somewhat non-trivial when we talk about priveledged guest execution. Guest R0 code is executed in virtualized R0 (technically, in host kernel, inside ioctl() performed by EMT), and in sense, R0 code has its own preemption mechanism (details depends on virtualization technology used). Device emulation code is also partially in R0, but probably not of much relevance here.
Guest SMP spawns multiple threads of execution (thus can use multiple physical CPUs), and they interact via emulated interrupt controller (APIC) and indirectly via shared resources locks (such as device lock).
Is there any specific problem you see?


Christian Pötzsch пишет:
> Hi,
> AFAIK, there is one EMT thread per VM and as different VM's are 
> executed as different processes they are scheduled by the host OS 
> scheduler. In the SMP case is more than one EMT thread, but these 
> threads are schedules by the OS as well.
> I will resent this to the dev mailing list, cause there are people 
> which know that stuff much more. Please ask and answer there.
> Christian
> On 7/2/10 7:19 AM, Suk Kyu Lee wrote:
>> Hello,
>> My name is Suk Kyu Lee and I’m a graduate research assistant at Korea 
>> University.
>> I’m currently doing a research regarding about virtualization and was 
>> using the VirtualBox OSE 3.1.6.
>> I was wondering if it is possible to know the general idea of the how 
>> the VM scheduling mechanism within the Virtual Box.
>> I was having some problem with the code and it appears that there are 
>> EMT thread within each VM, but couldn’t find the location within the 
>> code regarding about how the VMM schedules the VM.
>> Thank you.
>> Sincerely,
>> Suk Kyu Lee

More information about the vbox-dev mailing list