SC SCHEDULER HEDULER AC ACTI TIVATIONS VATIONS Effective Kernel - - PowerPoint PPT Presentation

sc scheduler heduler ac acti tivations vations
SMART_READER_LITE
LIVE PREVIEW

SC SCHEDULER HEDULER AC ACTI TIVATIONS VATIONS Effective Kernel - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

SC SCHEDULER HEDULER AC ACTI TIVATIONS VATIONS

Effective Kernel Support for the User-level Management of Parallelism

Thomas mas E. Anders erson

  • n, 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

slide-2
SLIDE 2

Source: http://siber.cankaya.edu.tr/OperatingSystems/week5/node5.html

slide-3
SLIDE 3

 Thread library’s code +

data structures in user space

 Invocation of library

function = local function call. Not system call PROS CONS NS Good performance

  • fast thread

switches

  • Scale better

Poor concurrency support

  • blocking

system calls starve ve sibling threads

Highly flexible

  • Custom

scheduling algorithm

slide-4
SLIDE 4

THR HREAD AD SY SYST STEM M -KE KERNEL L LE LEVE VEL

 Thread library’s code +

data structures in kernel space

 Invocation of library

function = system call PROS CONS NS

Good concurrency support

  • Blocking

system calls do not starve sibling threads

Poor performance

  • Operations

involve system calls

  • Full context

switch to perform thread switches

Less Flexible

  • Generic

scheduling Algorithm

slide-5
SLIDE 5

Us User er Threads eads

1.

Excellent performance

  • No system

m calls to perform thread operations

2.

More flexible =>Can use domain specifi fic scheduling algorithm (‘customized’ thread library)

3.

Blocking system calls such as I/O problematic; Starvation of sibling threads

Kernel rnel Threads ads

1.

Bad performance

  • System

tem calls needed ded to perform

  • rm thread operation
  • ns

2. 2.

Generi neric sche chedul uling ng algorithm hm( scheduled by kernel)

3.

Good integr grati ation

  • n with system

services – blocking calls do not prevent other user threads from being scheduled. Less likelihood

  • f starvat

atio ion

slide-6
SLIDE 6

Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism, Anderson et al

slide-7
SLIDE 7

Source :Operating System Concepts, 7th edition, Silberschatz, Galvin and Gagne

slide-8
SLIDE 8

 A mechanism through which we can obtain

Performance & flexibility of user-level threads

+

Functionality of kernel threads

slide-9
SLIDE 9

Communication scheme between the user- thread library and the kernel

Upcalls

Data Structures

 Scheduler activation stacks  Activation control block

Punish greedy apps

slide-10
SLIDE 10

 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

slide-11
SLIDE 11

Source - https://www.cs.columbia.edu/~smb/classes/s06-4118/l05.pdf

slide-12
SLIDE 12

 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

slide-13
SLIDE 13

 #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

slide-14
SLIDE 14
slide-15
SLIDE 15

 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?

slide-16
SLIDE 16

 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

slide-17
SLIDE 17
slide-18
SLIDE 18

Computation Intensive I/O Intensive

slide-19
SLIDE 19

 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
slide-20
SLIDE 20

 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

  • n, 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