High Performance Computing Lecture 18: Preemptive Scheduling Policies and Process Lifetime, Slides of Computer Science

This document from docsity.com covers the topic of preemptive scheduling policies in the context of high performance computing. Round robin and priority-based scheduling, as well as multilevel feedback queue scheduling. Additionally, the document explains the concept of process lifetime and the difference between virtual time, elapsed time, and wallclock time.

Typology: Slides

2012/2013

Uploaded on 04/28/2013

dewaan
dewaan 🇮🇳

3.8

(4)

43 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
High Performance Computing
Lecture 18
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download High Performance Computing Lecture 18: Preemptive Scheduling Policies and Process Lifetime and more Slides Computer Science in PDF only on Docsity!

High Performance Computing

Lecture 18

2

Preemptive Scheduling Policies

1. Round robin

 Maintain a FCFS ReadyQ  When the currently running process is preempted, schedule the process from the front of the ReadyQ  Insert the previously running process at the end of the ReadyQ  This is much fairer than any of the non- preemptive scheduling policies

4

Example: Multilevel Feedback

 Used in some kinds of UNIX

 A Preemptive, Priority-based policy

 Multilevel: OS maintains one readyQ per

priority level

 It schedules the process from the front of the highest priority non-empty queue

 Feedback: Priorities are not fixed

 A process could be moved to a lower/higher priority queue for fairness

5

Recall: Process Lifetime

 Process Lifetime: Time between fork() that

created the process and exit() that causes its

termination

7

Recall: Process Lifetime

 Process Lifetime: Time between fork() that

created the process and exit() that causes its

termination

 At any given point in time, a running process

is executing either in user mode or in system

mode

 Can find out the total CPU time used by a

process, as well as CPU time in user mode,

CPU time in system mode

8

Time: Process virtual and Elapsed

P1 P2 (^) P3 (^) P1 P P1 P : Running in user mode : Running in system mode Elapsed time Process P virtual time Wallclock time Real time time Process P virtual time

10

Exceptions

 Certain exceptional events that occur during

program execution, handled by the

processor HW

 There are two kinds of exceptions

  1. Traps  Page fault, Divide by zero, System call
  2. Interrupts  Timer, keyboard, disk : Synchronous, software generated : Asynchronous, hardware generated

11

What Happens on an Exception

1. Hardware

  • Saves processor state
  • Transfers control to corresponding piece of OS code, called the exception handler

2. Software (exception handler)

  • Takes care of the situation as appropriate
  • Ends with return from exception instruction

3. Hardware (execution of RFE instruction)

  • Restores the saved processor state
  • Transfers control back to the saved PC value