SC SCHEDULER HEDULER AC ACTI TIVATIONS VATIONS Effective Kernel Support for the User-level Management of Parallelism Thomas mas E. Anders erson on, Bria ian n N. Bers rsha had, Edward rd D. Lazows wska, ka, Henry ry M. Levy Febru bruary ry 1992 Presenter – Anit itha ha Suryanarayan
Source: http://siber.cankaya.edu.tr/OperatingSystems/week5/node5.html
Thread library’s code + PROS CONS NS data structures in user Good Poor space performance concurrency Invocation of library support ◦ fast thread function = local switches ◦ blocking function call. Not ◦ Scale better system calls starve ve sibling system call Highly threads flexible ◦ Custom scheduling algorithm
THR HREAD AD SY SYST STEM M -KE KERNEL L LE LEVE VEL PROS CONS NS Thread library’s code + Good Poor data structures in kernel concurrency performance space support ◦ Operations Invocation of library involve system ◦ Blocking calls function = system call system calls ◦ Full context do not starve switch to sibling threads perform thread switches Less Flexible ◦ Generic scheduling Algorithm
User Us er Threads eads Kernel rnel Threads ads Excellent performance Bad performance 1. 1. • No system m calls to perform • System tem calls needed ded to thread operations perform orm thread operation ons More flexible =>Can use Generi neric sche chedul uling ng algorithm hm( 2. 2. 2. domain specifi fic scheduling scheduled by kernel) algorithm (‘customized’ thread library) Good integr grati ation on with system 3. Blocking system calls such as services – blocking calls do not 3. I/O problematic; Starvation of prevent other user threads from sibling threads being scheduled. Less likelihood of starvat atio ion
Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism, Anderson et al
Source : Operating System Concepts, 7th edition , Silberschatz, Galvin and Gagne
A mechanism through which we can obtain Performance & flexibility of user-level threads + Functionality of kernel threads
Communication scheme between the user- thread library and the kernel Upcalls Data Structures Scheduler activation stacks Activation control block Punish greedy apps
Each process is allocated a number of virtual ual processor cessors instead of kernel threads Each process can decide what to do with the CPUs it has been allocated. This abstraction, presented in the form of sch cheduler duler act ctiva vatio tions ns allows ◦ The kernel to have control over processor allocations ◦ The user process to have control over its share of processors
Source - https://www.cs.columbia.edu/~smb/classes/s06-4118/l05.pdf
Add this proces cesso sor (processor #) ◦ Execute a runnable user-level thread. Processo cessor r has been n preempt empted ed (preempted activation # and its machine state) ◦ Return to the ready list the user-level thread that was executing in the context of the preempted scheduler activation. Sch chedu eduler ler activ ivation ation has block cked ed (blocked activation #) ◦ The blocked scheduler activation is no longer using its processor. Sch chedu eduler ler activ ivation ation has unblo locked ked (unblocked activation # and its machine state) ◦ Return to the ready list the user-level thread that was executing in the context Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism, Anderson et al
#R #Runnable nnable Th Threads eads != != # P # Processors essors Add more processors essors (additional # of processors needed) ◦ Allocate more processors to this address space and start them running scheduler activations. This s processor essor is idle () ◦ Preempt this processor if another address space needs it. Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism, Anderson et al
Preempting a thread that is running in its critical section ◦ Why is this a problem? ◦ Does it exist with kernel threads? How is it managed through scheduler activation?
The Topa paz OS OS and FastThre stThreads ads thread library was modified to implement scheduler activations Performance Optimizations No lock latency because threads running their critical sections are not preempted Recycle scheduler activations
Computation Intensive I/O Intensive
To gain performance and improve flexibility, export some functionalities out of the kernel and maintain just enough communication to ensure that the kernel can do its job. Implementations ◦ TAOS ◦ MACH 3.0 ◦ BSD/OS ◦ Digital Unix
Op Operati ating ng System m Conce cepts, pts, 7t 7th edition, ion, Silberschatz, Galvin and Gagne Moder ern n Op Operating ing Systems ms 3r 3rd Edition on, Andrew S. Tanenbaum An Implementation of Scheduler Activations on the NetBSD Operating System - Nathan J. Williams http://web.mit.edu/nathanw/www/usenix/freenix-sa/freenix-sa.html ◦
Recommend
More recommend