Scheduler ActivationsWith some slides modified fromRaymond Namyst, U. Bordeaux
User-level ThreadsUser Mode        Scheduler     Scheduler   Scheduler         Process A   Process B    Process C         ...
User-level ThreadsFast thread management (creation, deletion,switching, synchronisation…)Blocking blocks all threads in a ...
Kernel-Level ThreadsUser Mode         Process A   Process B   Process C                     SchedulerKernel Mode
Kernel-level ThreadsSlow thread management (creation, deletion,switching, synchronisation…)• System callsBlocking blocks o...
Hybrid MultithreadingUser Mode        Scheduler     Scheduler   Scheduler         Process A   Process B    Process C      ...
Hybrid MultithreadingCan get real thread parallelism onmultiprocessorBlocking still a problem!!!
Scheduler Activations• First proposed by [Anderson et al. 91]• Idea: Both schedulers co-operate      • User scheduler uses...
Scheduler Activations• Instead of         CPU time wasted                syscallUser Space                    I/O request ...
Upcalls to User-level            scheduler• New  – Allocated a new virtual CPU  – Can schedule a user-level thread• Preemp...
Working principle• Blocking syscall scenario on 2 processors                   Process                User scheduler
Working principle• Blocking syscall scenario on 2 processors                    Process                      new
Working principle• Blocking syscall scenario on 2 processors                   Process                     new
Working principle• Blocking syscall scenario on 2 processors                   Process
Working principle• Blocking syscall scenario on 2 processors                   Process                     preempt        ...
Working principle• Blocking syscall scenario on 2 processors                   Process
Working principle• Blocking syscall scenario on 2 processors                   Process                       Blocking sysc...
Working principle• Blocking syscall scenario on 2 processors                   Process                    New + blocked
Working principle• Blocking syscall scenario on 2 processors                   Process                             I/O com...
Working principle• Blocking syscall scenario on 2 processors                    Process                       Unblocked
Working principle• Blocking syscall scenario on 2 processors                   Process
Scheduler Activations• Thread management at user-level  – Fast• Real thread parallelism via activations  – Number of activ...
Adoption• Adopters  – BSD “Kernel Scheduled Entities”  – K42  – Digital UNIX  – Solaris  – Mach• Linux -> kernel threads
Upcoming SlideShare
Loading in …5
×

Scheduler activations

879 views
755 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
879
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Scheduler activations

  1. 1. Scheduler ActivationsWith some slides modified fromRaymond Namyst, U. Bordeaux
  2. 2. User-level ThreadsUser Mode Scheduler Scheduler Scheduler Process A Process B Process C SchedulerKernel Mode
  3. 3. User-level ThreadsFast thread management (creation, deletion,switching, synchronisation…)Blocking blocks all threads in a process– Syscalls– Page faultsNo thread-level parallelism on multiprocessor
  4. 4. Kernel-Level ThreadsUser Mode Process A Process B Process C SchedulerKernel Mode
  5. 5. Kernel-level ThreadsSlow thread management (creation, deletion,switching, synchronisation…)• System callsBlocking blocks only the appropriate thread ina processThread-level parallelism on multiprocessor
  6. 6. Hybrid MultithreadingUser Mode Scheduler Scheduler Scheduler Process A Process B Process C SchedulerKernel Mode
  7. 7. Hybrid MultithreadingCan get real thread parallelism onmultiprocessorBlocking still a problem!!!
  8. 8. Scheduler Activations• First proposed by [Anderson et al. 91]• Idea: Both schedulers co-operate • User scheduler uses system calls • Kernel scheduler uses upcalls!• Two important concepts – Upcalls • Notify the user-level of kernel scheduling events – Activations • A new structure to support upcalls and execution – approximately a kernel thread • As many running activations as (allocated) processors • Kernel controls activation creation and destruction
  9. 9. Scheduler Activations• Instead of CPU time wasted syscallUser Space I/O request interruptKernel SpaceHardware• …rather use the following scheme: CPU usedUser Space upcall upcallKernel SpaceHardware
  10. 10. Upcalls to User-level scheduler• New – Allocated a new virtual CPU – Can schedule a user-level thread• Preempted – Deallocated a virtual CPU – Can schedule one less thread• Blocked – Notifies thread has blocked – Can schedule another user-level thread• Unblocked – Notifies a thread has become runnable – Must decided to continue current or unblocked thread
  11. 11. Working principle• Blocking syscall scenario on 2 processors Process User scheduler
  12. 12. Working principle• Blocking syscall scenario on 2 processors Process new
  13. 13. Working principle• Blocking syscall scenario on 2 processors Process new
  14. 14. Working principle• Blocking syscall scenario on 2 processors Process
  15. 15. Working principle• Blocking syscall scenario on 2 processors Process preempt Preempt
  16. 16. Working principle• Blocking syscall scenario on 2 processors Process
  17. 17. Working principle• Blocking syscall scenario on 2 processors Process Blocking syscall
  18. 18. Working principle• Blocking syscall scenario on 2 processors Process New + blocked
  19. 19. Working principle• Blocking syscall scenario on 2 processors Process I/O completion
  20. 20. Working principle• Blocking syscall scenario on 2 processors Process Unblocked
  21. 21. Working principle• Blocking syscall scenario on 2 processors Process
  22. 22. Scheduler Activations• Thread management at user-level – Fast• Real thread parallelism via activations – Number of activations (virtual CPU) can equal CPUs• Blocking (syscall or page fault) creates new activation – User-level scheduler can pick new runnable thread.• Fewer stacks in kernel – Blocked activations + number of virtual CPUs
  23. 23. Adoption• Adopters – BSD “Kernel Scheduled Entities” – K42 – Digital UNIX – Solaris – Mach• Linux -> kernel threads

×