Skip to contentSkip to conversation

The UML scheduler

uml-devel Young Koh 2 participants 4 messages May 16, 2005 User-mode Linux (UML)

lore
Share & tools
lore

Young Koh

author
#0 lore raw

Hi,

I have studied the UML kernel a bit but it was hard to understand from the code and some document in the web site. I have some questions about the scheduling in UML. so, if anyone answer these, i really appreciate it. Thank you!

As long as i know, each process running on top of UML kernel is viewed as a process to the host kernel. then, the host kernel will try to schedule the UML processes as normal processes. well, i'll have an example.

suppose there are 2 processes on top of UML and 3 host processes. then, the host kernel sees 5 processes total, so, each of the process will get 20% of the CPU time? is that right?

Or, UML is somehow viewed as a group of processes and UML get 25% of the CPU and each UML got 12.5% of the CPU time? if so, how is it possible?

one more question, when the UML kernel wants to schedule its processes, how does it preempt UML processes?

this way of scheduling and preemption will be different from TT mode and SKAS mode? if so, how?

Thank you,

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&opÌk
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 3 lines · Young Koh

suppose there are 2 processes on top of UML and 3 host processes. then, the host kernel sees 5 processes total, so, each of the process will get 20% of the CPU time? is that right?

In tt mode, there will be 5 processes, but it will be difficult for the 2 UML processes to each get 20% of the time, since only one of them will be runnable at a time on the host. This is still unfair because each of them will have a higher dynamic priority than the 3 host processes because they are each only runnable half the time.

In skas mode, there is only one host process for all of the UML processes.

Quoted 3 lines

Or, UML is somehow viewed as a group of processes and UML get 25% of the CPU and each UML got 12.5% of the CPU time? if so, how is it possible?

In skas mode, this is true.

Quoted 2 lines

one more question, when the UML kernel wants to schedule its processes, how does it preempt UML processes?

The same way as any other architecture. A timer tick comes in, and the timer handler calls schedule().

Quoted 2 lines

this way of scheduling and preemption will be different from TT mode and SKAS mode? if so, how?

No, exactly the same.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#2 lore raw

Thank you for your reply. I have one following question.

in native Linux, a timer tick goes to the kernel, which has the previliege to save the current context and switch the running process. But UML kernel is just another user level process, even though it is tracing the application processes. in UML case, when a timer tick goes to the UML kernel, how does it stop the running process, which is another process?

it seems it's a primitive quesion, but it will help me a lot to understand more about UML. Thank you!

Quoted 25 lines · Jeff Dike
Quoted 3 lines · Young Koh

suppose there are 2 processes on top of UML and 3 host processes. then, the host kernel sees 5 processes total, so, each of the process will get 20% of the CPU time? is that right?

In tt mode, there will be 5 processes, but it will be difficult for the 2 UML processes to each get 20% of the time, since only one of them will be runnable at a time on the host. This is still unfair because each of them will have a higher dynamic priority than the 3 host processes because they are each only runnable half the time.

In skas mode, there is only one host process for all of the UML processes.

Quoted 3 lines

Or, UML is somehow viewed as a group of processes and UML get 25% of the CPU and each UML got 12.5% of the CPU time? if so, how is it possible?

In skas mode, this is true.

Quoted 2 lines

one more question, when the UML kernel wants to schedule its processes, how does it preempt UML processes?

The same way as any other architecture. A timer tick comes in, and the timer handler calls schedule().

Quoted 7 lines
Quoted 2 lines

this way of scheduling and preemption will be different from TT mode and SKAS mode? if so, how?

No, exactly the same.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_ids93&alloc_id281&opÌk
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw
Quoted 8 lines · Young Koh

Thank you for your reply. I have one following question.

in native Linux, a timer tick goes to the kernel, which has the previliege to save the current context and switch the running process. But UML kernel is just another user level process, even though it is tracing the application processes. in UML case, when a timer tick goes to the UML kernel, how does it stop the running process, which is another process?

Look at switch_to_{skas,tt}. In tt mode, it's one process waking another by writing to a pipe, then sleeping by reading its own pipe. In skas mode, it's a longjmp and a memory switch.

Jeff

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel