lecture06

lecture06 - CS140 - Winter 2008 - Handout #6 Scheduling -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS140 - Winter 2008 - Handout #6 1 CS 140: Operating Systems Lecture 6: CPU Scheduling Mendel Rosenblum Scheduling -- Overview ± Simple: put a variety of jobs on N processors P1 P2 PN Scheduling: what job to run? ± We’ll have three main goals (many others possible) ± minimize response/completion time response time = what the user sees: elapsed time to echo keystroke to editor (acceptable delay ~50-150millisec) completion time: start to finish of job ± Maximize throughput: operations (=jobs) per second minimize overhead (context switching) efficient use of resources (CPU, disk, cache, …) ± Fairness: share CPU “equitably” Tension: unfair makes system faster. .. time gcc completion When does scheduler make decisions? ± Non preemptive minimum: process runs until voluntarily relinquish CPU: » process blocks on an event (e.g., I/O or synchronization) » process terminates ± Preemptive minimum All of the above, plus: Event completes: process moves from blocked to ready Timer interrupts Impl: process can be interrupted in favor of another running Yield ready blocked I/O,join,block I/o completes, child exits, unlock dead scheduled exit Implicit insight: I/O device = special CPU ± I/O device ~ one special purpose CPU “special purpose” = disk drive can only run a disk job, tape drive a tape job, … ± Implication: computer system with n I/O devices ~ n+1 CPU multiprocessor Result: all I/O devices + CPU busy = n+1 fold speedup! overlap them just right? ave. completion time ~ halved. grep Matrix mult Blocked on disk running Process *model* ± Process alternates between CPU and I/O bursts CPU-bound job: long CPU bursts I/O-bound job: short CPU bursts I/O burst = process idle, switch to another “for free” Problem: don’t know job’s type before running ± An underlying assumption: “response time” most important for interactive jobs, which will be I/O bound emacs Matrix mult
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS140 - Winter 2008 - Handout #6 2 Universal scheduling theme ± General multiplexing theme: what’s “the best way” to run n processes on k nodes? (k < n) we’re (probably) always going to do a bad job ± Problem 1: mutually exclusive objectives no one best way latency vs throughput conflicts speed vs fairness ± Problem 2: incomplete knowledge User determines what’s most important. Can’t mind read Need future knowledge to make decision and evaluate impact ± Problem 3: real systems = mathematically intractable Scheduling very ad hoc. “Try and see” Scheduling ± Until now: Processes. From now on: resources Resources are things operated on by processes e.g., CPU time, disk blocks, memory page, network bufs ± Two ways to categorize resources: Non-preemptible: once given, can’t be reused until process gives back. Locks, disk space for files, terminal.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/24/2008 for the course CS 140 taught by Professor Rosenblum during the Winter '08 term at Stanford.

Page1 / 5

lecture06 - CS140 - Winter 2008 - Handout #6 Scheduling -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online