Professional Documents
Culture Documents
Overview of Scheduling For Multiprocessor Real-Time System: Xuan Qi
Overview of Scheduling For Multiprocessor Real-Time System: Xuan Qi
Multiprocessor Real-Time
System
Xuan Qi
Outline
Traditional Scheduling
Multiprocessor Scheduling
Real-Time Scheduling (single processor)
Scheduling for Real-Time System on
Multiprocessor
Why Need Scheduling?
Sharing always results in contention
Intersection
Design Issues
Application model
Preemption
Overhead
SJF:
Pros: minimum waiting time and turnaround time
Cons: starvation, can’t be implemented
Round-Robin:
Pros: simple, low overhead, works for interactive systems
Cons:
if quantum is too small, too much time wasted in context switching
if too large (i.e., longer than mean CPU burst), approaches FCFS
What do we want to deal with
now?
Multiprocessor
Real-Time
Time requirement
Outline
Traditional Scheduling
Multiprocessor Scheduling
Real-Time Scheduling (single processor)
Scheduling for Real-Time System on
Multiprocessor
Scheduling for Multiprocessor
Problem
Given a set J of jobs where job ji has length li and a number
of processors m, what is the minimum possible time
required to schedule all jobs in J on m processors such that
none overlap?
Goal
Minimize max execution time of all the processors
E.g.
Schedule 1: P1: 4, 5 P2: 1 EXECUTION TIME: 9
Schedule 2: P1:4, 1 P2: 5 EXECUTION TIME: 5
Workload balancing
Bin-packing program: NP-Hard
Difficulties
Not only when a given task executes
(scheduling)
But where (assignment)
Other issues
resource constraints (shared cache or
memory)
communication
Issues
Partitioned or Global
Homogeneous or heterogeneous
processors
Application model
E.g.: with or without dependency
Scheduling for Multiprocessor
Global queue – queue can be a bottleneck
Goal
Meet the deadline
Fully utilize the CPU
Energy & reliability consideration
Real-Time Scheduling (single
processor)
What do we need to consider when
designing scheduling algorithm?
Task model
Preemption
Priority assignment
Fixed-priority: period, utilization
Dynamic-priority: deadline
Real-Time Scheduling (single
processor)
Task Model
Periodic or Aperiodic
With or without dependency
Classic Algorithms
Assumptions [2]
Single processor
Task model: periodic
Dependency: no
Preemption: yes
Fixed-Priority Algorithm
Rate-Monotonic Scheduling: (RMS) [2]
The task with shorter period has higher priority
E.g. T1(1, 6), T2(1, 3), T3(5, 10)
Priority: T2 > T1 >T3 FIXED!!!
Dynamical-Priority Algorithm
Deadline-Driven Scheduling: (EDF) [2]
The task with earliest deadline has the highest priority
Deadline = period * n
E.g. T1(1, 6), T2(1, 3), T3(5, 10) T2 T1 T3 T2 T3
At time 0: T2 > T1 > T3
At time 1: T1> T3
At time 2: T3
At time 3: T2 > T3 DYNAMIC!!!
Summary of Classic
Algorithms
Fixed-Priority Algorithm
Rate-Monotonic Scheduling: (RMS)
Optimal fixed-priority algorithm
At least 0.693 system utilization (Liu & Layland Bound) [2]
Statically 0.88 system utilization [4]
Dynamical-Priority Algorithm
Deadline-Driven Scheduling: (EDF)
Optimal dynamic-priority algorithm
Achieve system utilization 1 [2]
Alternate Perspective
Which task?
Which processor? (assignment)
What time? (scheduling)
Meet deadline
Goal
Meet the time requirement
Minimize the number of processors to use
Energy management
Reliability
Issues
Homogeneous or heterogeneous
processors
Application model
E.g.: with or without dependency
Resource constraints (memory, cache)
Partitioned or Global
Preemption
Overhead
Classic Results
Assumptions
Homogenous processors
Periodic tasks without dependency
Resource constraints: No
Preemption: Yes
Overhead: will be discussed
Global or partitioned?
How to assign priority?
Global or Partitioned
Global [1]
How about borrowing the classic algorithms (RMS & EDF)?
CPU utilization can be extremely low.
Hard to guarantee to meet deadline
Turns out to be very complex to design
Partitioned [1]
On each processor: the same as before
Reuse classic algorithms (RMS & EDF)
Easy to check if deadline is met with LLB
May not exploit the hidden global beneficial feature
Intractability
Global: RMS and EDF won’t work
Neither of them is optimal any more [1]
E.g. Rate-Monotonic Scheduling
10 bag, each has capacity up to 10lb
10 apples, each with weight 1lb, and another one apple with weight 9.1lb
RMS: put into each bag one apple of 1lb first
The 9.1lb apple won’t fit any bag
Utilization 10% 10 bags
Details can be found in [1]
Partitioned:
Similar to bin-packing problem …
NP-Hard [3]
Heuristic Algorithms for
Partitioning
First-Fit, Next-Fit, Best-Fit, Worst-Fit
Future Work
Scheduling for power saving
Some work has already been done
Use the redundancy to improve reliability
Etc.
References
[1] S. K. Dhall and C.L. Liu. On a real-time Scheduling Problem.
Operations Research, 26(1): 127-140, 1978.