Thomas E. Anderson, Brian N. Bershad,

Slides:



Advertisements
Similar presentations
Scheduler Activations: Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
Advertisements

User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Akbar.
CS 5204 – Operating Systems 1 Scheduler Activations.
Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
User-Level Interprocess Communication for Shared Memory Multiprocessors Bershad, B. N., Anderson, T. E., Lazowska, E.D., and Levy, H. M. Presented by Chris.
SCHEDULER ACTIVATIONS Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska, Henry.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
Scheduler Activations Effective Kernel Support for the User-Level Management of Parallelism.
Threads vs. Processes April 7, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
1 Thursday, June 15, 2006 Confucius says: He who play in root, eventually kill tree.
USER LEVEL INTERPROCESS COMMUNICATION FOR SHARED MEMORY MULTIPROCESSORS Presented by Elakkiya Pandian CS 533 OPERATING SYSTEMS – SPRING 2011 Brian N. Bershad.
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
Scheduler Activations : Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
G Robert Grimm New York University Scheduler Activations.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Scheduler Activations Jeff Chase. Threads in a Process Threads are useful at user-level – Parallelism, hide I/O latency, interactivity Option A (early.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Operating Systems CSE 411 CPU Management Sept Lecture 11 Instructor: Bhuvan Urgaonkar.
Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism by Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Scheduler Activations: Effective Kernel Support for the User- Level Management of Parallelism. Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Thread Scheduling.
Scheduler Activations: Effective Kernel Support for the User-level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 13 Threads Read Ch 5.1.
CSE 60641: Operating Systems Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism. Thomas E. Anderson, Brian N.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
ITFN 3601 Introduction to Operating Systems Lecture 3 Processes, Threads & Scheduling Intro.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Department of Computer Science and Software Engineering
Brian Bershad, Thomas Anderson, Edward Lazowska, and Henry Levy Presented by: Byron Marohn Published: 1991.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Jonas Johansson Summarizing presentation of Scheduler Activations – A different approach to parallelism.
Scheduler activations Landon Cox March 23, What is a process? Informal A program in execution Running code + things it can read/write Process ≠
Threads Overview Benefits, User and Kernel Threads.
Processes and threads.
Process Management Process Concept Why only the global variables?
PROCESS MANAGEMENT IN MACH
CS 6560: Operating Systems Design
Achieving Multiprogramming Scalability of Parallel Programs on Intel SMP Platforms: Nanothreading in the Linux Kernel Christos D. Antonopoulos Panagiotis.
Processes and Threads Processes and their scheduling
Scheduler activations
Threads and Scheduling
Multithreaded Programming in Java
Chapter 4: Multithreaded Programming
Intro to Processes CSSE 332 Operating Systems
Process Virtualization. Process Process is a program that has initiated its execution. A program is a passive entity; whereas a process is an active entity.
Scheduler Activations
By Brian N. Bershad, Thomas E. Anderson, Edward D
Multithreaded Programming
Thread Implementation Issues
Fast Communication and User Level Parallelism
Threads Chapter 4.
Presented by Neha Agrawal
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Presented by: SHILPI AGARWAL
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M
Threads vs. Processes Hank Levy 1.
CS510 Operating System Foundations
CS703 – Advanced Operating Systems
CSE 542: Operating Systems
Threads CSE 2431: Introduction to Operating Systems
Threads.
CS Introduction to Operating Systems
Presentation transcript:

Scheduler Activations: Effective Kernel Support for the User-Level Management of Parallelism Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska, and Henry M. Levy. Presented by Shiyan Tao

Scheduler Activations Threads Vehicle for concurrency in many approaches to parallel programming. User-Level Threads Kernel-Level Threads 2019/4/11 Scheduler Activations

User-Level Threads - pros high performance No kernel intervention. Managed by a Runtime library routine linked to each application. inexpensive operation. Thread scheduling happens in user space. flexible No kernel modification. Different application can be linked with different user-level thread libraries. 2019/4/11 Scheduler Activations

User-Level Threads – cons But… Poor Integration The thread package views each process as a virtual processor. These virtual processors are multiplexed across a fixed number of processors by the underlying kernel. If one thread blocks on a system call, such as I/O or page faults, the whole process is blocked even if there are runnable threads. Kernel support is needed. 2019/4/11 Scheduler Activations

Scheduler Activations Kernel-Level Threads high functionality. Kernel directly schedules each application’s threads onto physical processors. Avoid system integration problems. Kernel schedules thread from same or other address space. poor performance Kernel threads use system calls to perform operations.Even switching between threads in the same address space requires a full context switch. lack of flexibility Kernel thread system must support the need of every application that runs it. 2019/4/11 Scheduler Activations

User-level Threads on top of Kernel-Level threads? “Kernel threads are the wrong abstraction for supporting user-level thread management.” The kernel is unaware of user-level threads. Kernel threads block, resume, and are preempted without notification to user level . Kernel threads are scheduled obliviously with respect to the user-level thread state. 2019/4/11 Scheduler Activations

Scheduler Activations Integration Issues A kernel thread could be preempted while its user-level thread is holding a spin-lock. --Spin-wait then. A kernel thread could be preempted to allow another kernel thread to run that happens to be idling in its user-level threads. A kernel thread running high-priority user-level threads may be preempted in favor of a kernel thread that happen to be running low-priority user-level threads. When a user-level thread block, its kernel thread blocks too. can run out of kernel threads even when there are runnable threads and processors are idle. 2019/4/11 Scheduler Activations

Scheduler Activations Goal In the common case when kernel intervention is not needed. do as well as user-level. In the infrequent case when kernel must be involved: No processor idles when thread ready. No higher-priority thread waits while a lower-priority thread runs. During a thread trap (page fault), the processor on which the thread was running can be used to run another thread from the same or a different address space. Allow application-specific customization. 2019/4/11 Scheduler Activations

Approach: Scheduler Activation Structure to provide communication between the kernel-level scheduler and the user-level thread system. Serve as a vessel for running user-level threads, in exactly the same way that a kernel thread does; Vector control from the kernel to the user-level thread system on kernel event. It’s essentially an upcall which invokes a handler function in the user-level thread library. One scheduler activation per processor assigned to address space. 2019/4/11 Scheduler Activations

Scheduler Activations The kernel provides each process with its own virtual multiprocessor. But kernel may change the number of processors during the execution. Kernel allocates processors to address spaces. User level threads system has complete control over scheduling-which thread run on which allocated processor. Kernel notifies user-level thread system whenever it changes the number of processors assigned to it or whenever a user-level thread blocks or wakes up in the kernel. User-level thread system notifies kernel when application needs more or fewer processors. The kernel uses this information to allocate processors among address space. 2019/4/11 Scheduler Activations

Scheduler Activations, cont’d Once a scheduler activation’s user-level thread is stopped by the kernel, that activation is done. A new activation will be created to notify the user-level thread system that it has been stopped. The user-level system removes the state of that thread from the old activation, tell the kernel that the old activation can be reused, and finally decide which thread to run on the processor. V.S. Traditional kernel threads Kernel never notifies the user-level of the event. 2019/4/11 Scheduler Activations

Example of the use of scheduler activation T1: The application receives two processors to run on from the kernel. It starts running threads on them. T2: One of the user-level threads blocks in the kernel. Kernel uses a fresh scheduler activation to notify the user-level system of this. T3: The blocking-event completes. Kernel preempts second processor to do the upcall. Upcall notifies user level of upcall and of event completion. T4: Upcall takes the thread from the ready list and begins running it. The first two scheduler activations have now been discarded and replaced. 2019/4/11 Scheduler Activations

Processor Reallocations Goal: No idle processor in presence of runnable threads. Processor allocation based on available parallelism in each address space. Kernel notified when: User-level has more runnable threads than processors User-level has more processors than runnable threads Kernel uses notifications as hints for its actual processor allocation. 2019/4/11 Scheduler Activations

Scheduler Activations Critical Sections When an upcall informs the user-level thread system that a thread has been preempted which happens to be executing in its critical section. make a copy of each low-level critical section. At the end of the copy, we place code to yield the processor back to the upcall. If a preemption occurs, continue the thread at the corresponding place in the copy of the critical section. The copy relinquishes control back to the original upcall at the end of the critical section. 2019/4/11 Scheduler Activations

Scheduler Activations Implementation Modified Topaz, the native OS for DEC SRC Firefly multiprocessor workstation, to implement scheduler activations. Modified FastThreads, a user-level thread system originally designed to run on top of Topaz kernel threads, to handle the user-level thread system. User-level applications are free to choose any thread scheduling policy they like. Discarded scheduler activations can be collected and returned to the kernel for reuse, avoiding the overhead of recreating them. 2019/4/11 Scheduler Activations

Scheduler Activations Performance with I/O 2019/4/11 Scheduler Activations

Scheduler Activations Performance w/o I/O 2019/4/11 Scheduler Activations

Scheduler Activations Summary User-level threads divide up the processor without the kernel’s knowledge. Fast and flexible but degrade when I/O and other kernel activities get in the way. Kernel level threads Slow and expensive to use. Managing threads at the user-level is needed to achieve high performance. But kernel threads or processes do not support this well. Scheduler activations provide an interface between the kernel and the user-level thread package. Kernel is responsible for processor allocation and notifying the user-level of events that affect it. User-level is responsible for thread scheduling and notifies the kernel of events that affect processor allocation decisions. 2019/4/11 Scheduler Activations