chapter 10: multiprocessor & real-time scheduling dynamic scheduling wednesday, october 5, 2011...

26
Chapter 10: Multiprocessor & Real-time Scheduling (prelim) Wednesday, October 5, 2011

Upload: trinhnhi

Post on 11-Mar-2018

232 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Chapter 10: Multiprocessor &

Real-time Scheduling(prelim)

Wednesday, October 5, 2011

Page 2: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Multiprocessor classes

• Loosely coupled (clusters)

• Special-purpose processors (CPU + GPU)

• Tightly coupled (SMP)

Wednesday, October 5, 2011

Page 3: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Synchronization granularity

• Independent

• Very coarse-grained

• Coarse-grained

• Medium-grained

• Fine-grained

Wednesday, October 5, 2011

Page 4: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Design issues

• Assignment of process to CPU

• Dynamic vs. static

• Master/slave vs. peer

• Multiprogramming

• Process dispatching

Wednesday, October 5, 2011

Page 5: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Lower number ==

identical process service times

Wednesday, October 5, 2011

Page 6: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

CPUCore

J I H G F E D C B A

High CoVHigh CoVHigh CoVHigh CoV

Process TS FCFS RR

A 100 100 118

B 2 101 11

C 2 103 12

D 2 105 13

E 2 107 14

F 2 109 15

G 2 111 16

H 2 113 17

I 2 115 18

J 2 117 19

Low CoVLow CoVLow CoVLow CoV

Process TS FCFS RR

A 2 2 11

B 2 3 11

C 2 5 12

D 2 7 13

E 2 9 14

F 2 11 15

G 2 13 16

H 2 15 17

I 2 17 18

J 2 19 19

B, C, D, ..., J arrive at time 1Wednesday, October 5, 2011

Page 7: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

CPU

CoreCore

J I H G F E D C B A

High CoVHigh CoVHigh CoVHigh CoV

Process TS FCFS RR

A 100 100 108

B 2 2 6

C 2 4 6

D 2 6 7

E 2 8 7

F 2 10 8

G 2 12 8

H 2 14 9

I 2 16 9

J 2 18 10

Low CoVLow CoVLow CoVLow CoV

Process TS FCFS RR

A 2 2 6

B 2 2 6

C 2 3 6

D 2 4 7

E 2 5 7

F 2 6 8

G 2 7 8

H 2 8 9

I 2 9 9

J 2 10 10

J I H G F E D C B A

B, C, D, ..., J arrive at time 1Wednesday, October 5, 2011

Page 8: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 9: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Thread scheduling

• Load sharing

• Gang sharing

• Dedicated processor assignment

• Dynamic scheduling

Wednesday, October 5, 2011

Page 10: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Load sharing

CPU

CoreCore

CoreCore

Memory

Thread

Thread

Thread

Thread

Thread

Thread

Thread

X

Wednesday, October 5, 2011

Page 11: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Gang scheduling

Wednesday, October 5, 2011

Page 12: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Gang scheduling

CPU

CoreCore

CoreCore

Memory

Thread

Thread

Thread

Thread

Thread

Thread

Thread

Wednesday, October 5, 2011

Page 13: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Dedicated processor assignment

• Extreme version of gang scheduling

• No multiprogramming (blocked thread)

• Utilization not emphasized

• No context switch gives speedup

Wednesday, October 5, 2011

Page 14: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

16 CPUssimultaneous execution

Wednesday, October 5, 2011

Page 15: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Real-time systems

Wednesday, October 5, 2011

Page 16: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 17: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Real-time scheduling

• Correctness

• Logical result of computation

• Time results produced

• Hard vs. soft real-time

• Periodic vs. aperiodic

Wednesday, October 5, 2011

Page 18: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Characteristics

• Determinism

• Responsiveness

• User control

• Reliability

• Fail-soft operation

Wednesday, October 5, 2011

Page 19: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 20: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Real-time scheduling

• Static table-driven

• Static priority-driven

• Dynamic planning-based

• Dynamic best effort

Wednesday, October 5, 2011

Page 21: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 22: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 23: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 24: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Rate monotonic scheduling

Rate = 1 / T

Higher rate ==> higher priority

Wednesday, October 5, 2011

Page 25: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Wednesday, October 5, 2011

Page 26: Chapter 10: Multiprocessor & Real-time Scheduling Dynamic scheduling Wednesday, October 5, 2011 Load sharing CPU Core Core Core Core Memory Thread Thread Thread Thread Thread Thread

Rate monotonic theorem

• Rate monotonic scheduling is optimal

• If any static priority scheduler meets all deadlines, so does RMS

• Does not guarantee best utilization

Wednesday, October 5, 2011