RE: SMP Scheduling

Jan Stoess <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
> 
>  - Threads have priorities. Threads in one priority class are served
>    round-robin. Higher priority queues are served first.

That's correct except for the UP-IPC path, where the scheduler is shortcut
in favor of a timeslice donation scheme. The SMP-IPC, path again uses the
scheduler, however, since synchronization (e.g., via IPIs) is needed anyway.

 
>  - A thread has a timeslice size and a "total quantum". Each time the
>    thread is preempted (or calls L4_Yield), the time it has consumed is
>    subtracted from the total quantum until it is depleted. At this point
>    the thread's scheduler gets a preemption message.
>  - Whether the preemption message is delivered to the scheduler or not,
>    a thread's quantum is reset to its initial value and the thread is
>    runnable again.
>  - Because preemption messages are sent with timeout 0, one would need
>    at least one thread per CPU that handles preemption
>    messages. Otherwise one could lose messages when the scheduler is
>    busy.

That's true with respect to the X.2 spec. The current implementation doesn't
use timeout 0, however, as you can see in tcb_t::send_preemption_ipc(u64_t
time) in kernel/src/api/v4/thread.cc. Afaik no-one has really used
preemption messages in the original L4KA:Pistachio. I know of several
prototypes addressing scheduling problems in L4, but no official version is
available (yet). 
 
Regards,
-Jan

--
Jan Stoess
System Architecture Group
University of Karlsruhe
Phone: +49 (721) 608-4056
Fax: +49 (721) 608-7664
eMail: [email protected]
smime.p7s (application/x-pkcs7-signature, 3.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.