jim anderson 1 multiprocessor fair scheduling the case for multiprocessor fair scheduling james h....

25
Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Upload: gervais-dean

Post on 27-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson1Multiprocessor Fair Scheduling

The Case for Multiprocessor Fair Scheduling

James H. Anderson

University of North Carolina at Chapel Hill

Page 2: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson2Multiprocessor Fair Scheduling

Real-time Adaptivity on Multiprocessors

Motivating Application: Whisper acoustic tracker for virtual environments.

TrackingComputer

Microphones on ceiling

Speakers on hands and feet

User

Page 3: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson3Multiprocessor Fair Scheduling

Whisper Characteristics

Workload requires a multiprocessor. Predictive techniques used in tracking.

» Time to compute next prediction depends on accuracy of previous prediction.

computational costs will vary.

» Lots of microphones/speakers lots of tasks!– Not practical to provision all tasks assuming max costs.

Question: How to ensure adaptive real-time execution on a multiprocessor?

Page 4: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson4Multiprocessor Fair Scheduling

Multiprocessor SchedulingPartitioning

Partition tasks so that each task always runson the same processor.

Steps:1. Assign tasks to processors

(bin packing).2. Schedule tasks on each

processor using uniprocessor algorithms.

Page 5: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson5Multiprocessor Fair Scheduling

Problems with Partitioning

Variations in computation costs may necessitate a re-partitioning.

Problematic because:» Partitioning = bin packing…

– …an intractable problem.

» Re-partitionings may cause task migrations…– … the very thing partitioning is designed to avoid.

Page 6: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson6Multiprocessor Fair Scheduling

Global SchedulingAn Alternative to Partitioning

A single scheduling algorithm is used thatschedules all tasks.

Important Difference:• Tasks may migrate among

the processors.• Probably appropriate only on tightly-coupled systems.

Rest of the Talk: Global scheduling algorithmsthat facilitate real-time adaptivity.Rest of the Talk: Global scheduling algorithmsthat facilitate real-time adaptivity.

Page 7: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson7Multiprocessor Fair Scheduling

Deadline SchedulingOur Focus

We consider deadline scheduling algorithms wherein:» tasks repeatedly submit “pieces of work” to

the system to schedule;» these pieces of work have deadlines;» the system schedules work on an earliest-

deadline-first basis.

Page 8: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson8Multiprocessor Fair Scheduling

The Periodic Task ModelThe Simplest Form of Recurrent Execution…

Periodic Tasks:» Task T = (T.e, T.p) releases a job with execution cost T.e

every T.p time units.– T’s weight (or utilization or processor share) is T.wt = T.e/T.p.

» Each job of T has a deadline at the next job release of T.

0 10 20 30

T = (2,5)

5 15 25

U = (9,15)

2 5

Page 9: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson9Multiprocessor Fair Scheduling

Job-based Scheduling Doesn’t Work

Can’t consider jobs as the pieces of work to schedule because deadlines can be missed.

Example: Scheduling three (2,3) tasks on two processors.

0 2

Processor 1

1 3

Processor 2 Job 1 of Task 2

Job 1 of Task 1 Job 1 of Task 3

misseddeadline!

(These threejobs haveequal deadlinesand hence areindistinguishable.)

Page 10: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson10Multiprocessor Fair Scheduling

Alternative: Pfair Scheduling

Basic Ideas:» Processor time is allocated in multiples of some

basic quantum.» Break jobs into quantum-length subtasks.» Assign deadlines to subtasks.

task migrationoccurs here

So, all pieces ofwork to schedulehave a cost of 1.

No deadlinesare missed!

0 2

Processor 1

1 3

Processor 2 Job 1 of Task 2

Task 1 Job 1 of Task 3

Task 1

Previous Example:

quantum

Page 11: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson11Multiprocessor Fair Scheduling

Some Details…Subtasks and Windows

Each subtask must execute within a certain time window.» End of window = deadline.

Window layout determined by task’s weight. Several optimal Pfair scheduling algorithms

are known.» Optimal = capable of ensuring all subtask (and

job) deadlines as long as T T.wt M (the no. of processors)

Page 12: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson12Multiprocessor Fair Scheduling

0 11 22 33 44 55 66 77 88 99 1010

First 6 windowsof a task Twith weight6/10

Windowing Example

T6

T5

T4

T3

T2

T1

Windows may be of two different lengths, and successivewindows may overlap by one quantum.

Deadline of T3

Subtasks

Page 13: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson13Multiprocessor Fair Scheduling

TIME 5 10 15

A 1/2

B 1/3C 1/3

E 2/9

D 2/9

Example Pfair Schedule

On Processor 1 TASKS On Processor 2

Page 14: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson14Multiprocessor Fair Scheduling

Question: Can Non-periodic Recurrent Tasks be Supported?

Yes!» Developed the “early-release” (ER) model.

– Enables work-conserving behavior.

» Developed the “intra-sporadic” (IS) model.– Generalizes the sporadic model.

» ER + IS = “rate-based”.

Page 15: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson15Multiprocessor Fair Scheduling

ER and IS Models

TIME 0 5 10 15 20

IS Delay

Early Release

Idea: Allow a subtask to execute “early”, i.e., before its window.

Idea: Allow “delays” between subtask windows.

TIME 0 5 10 15 20

ERfairness (“Early Release”)

ISfairness (“Intra-Sporadic”)

Page 16: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson16Multiprocessor Fair Scheduling

Question: Can Dynamic Tasks be Supported?

Yes! Results:

» Devised rules under which tasks can leave and join a running system.

These rules can be applied to adaptively reweight tasks.» Leave with old weight, join with new.

» However, a significant delay may be incurred.

(Dynamic = Tasks can Leave and Join)

Page 17: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson17Multiprocessor Fair Scheduling

Question: Can Quick Adaptations be Supported?

Yes! Two approaches:

» Reactive: Increase task shares when there is idleness (available capacity).– Resulting scheme: Quick-release fair (QRfair).

» Proactive: Allow tasks to register weight-change requests with the scheduler.– Resulting scheme: Proactive fair (PROfair).

Page 18: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson18Multiprocessor Fair Scheduling

Proactive vs. Reactive

spare capacitybecomes available

No adaptivity

idle processor encountered shift next window left

QRfair(reactive)

PROfair(proactive)

increase weight to consumeavailable capacity

(Figure depicts the window layout of one task)

Page 19: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson19Multiprocessor Fair Scheduling

QRfair ExperimentFrom RTSS 2003

Page 20: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson20Multiprocessor Fair Scheduling

Other Research

Devised efficient synchronization techniques for Pfair-scheduled systems.

Devised techniques for discouraging task migrations.

Devised techniques for minimizing bus contention in such systems.

Developed a prototype threads package. New Project: Use this threads package to re-

implement Whisper.

Page 21: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson21Multiprocessor Fair Scheduling

Conclusions

Partitioning seems ill-suited for highly adaptive multiprocessor systems.» Moreover, partitioning has been studied for over 20

years and isn’t likely to improve. The case for Global Scheduling (Pfair, in

particular) is likely to improve with further research.» More research needed (for example) on…

– support for device I/O,– coupling feedback control mechanisms with adaptive

reweighting schemes,– better techniques for discouraging migrations, particularly in

soft real-time systems,– etc. etc. etc.

Page 22: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson22Multiprocessor Fair Scheduling

ReferencesJ. Anderson, A. Block, and A. Srinivasan, Quick-release fair scheduling, Proceedings of the 24th IEEE Real-time Systems Symposium, pp. 130-141, December 2003.

J. Anderson, P. Holman, and A. Srinivasan, Fair multiprocessor scheduling, in Handbook on Scheduling: Algorithms, Models, and Performance Analysis, Joseph Y. Leung (ed.), Chapman and Hall/CRC, pp. 30.1-30.19, 2004.

J. Anderson and A. Srinivasan, Early-release fair scheduling, Proceedings of the 12th Euromicro Conference on Real-time Systems, pp. 35-43, June 2000.

J. Anderson and A. Srinivasan, Mixed Pfair/ERfair scheduling of asynchronous periodic tasks, Journal of Computer and System Sciences, 68(1):157-204, February, 2004. Preliminary version appeared in Proceedings of the 13th Euromicro Conference on Real-time Systems, pp. 76-85, June 2001.

S. Baruah, N. Cohen, C.G. Plaxton, and D. Varvel, Proportionate progress: A notion of fairness in resource allocation, Algorithmica, 15:600-625, 1996. S. Baruah, J. Gehrke, and C.G. Plaxton, Fast scheduling of periodic tasks on multiple resources, Proceedings of the 9th International Parallel Processing Symposium, pp. 280-288, April 1995.

Page 23: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson23Multiprocessor Fair Scheduling

References (Continued)U. Devi and J. Anderson, Fair integrated scheduling of soft real-time tardiness class on multiprocessor platforms, Proceedings of the 10th IEEE Real-time and Embedded Technology and Applications Symposium, pp. 554-561, May 2004.

U. Devi and J. Anderson, Improved conditions for bounded tardiness under EPDF fair multiprocessor scheduling, Proceedings of 12th International Workshop on Parallel and Distributed Real-Time Systems, April 2004 (on CD ROM).

U. Devi and J. Anderson, Schedulable utilization bounds for EPDF fair multiprocessor scheduling, Proceedings of the 10th International Conference on Real-time and Embedded Computing Systems and Applications, August 2004, to appear.

P. Holman, On the Implementation of Pfair-scheduled Multiprocessor Systems, Ph.D. Dissertation, University of North Carolina at Chapel Hill, August 2004.

P. Holman and J. Anderson, Guaranteeing Pfair supertasks by reweighting, Proceedings of the 22nd IEEE Real-time Systems Symposium, pp. 203-212, December 2001.

P. Holman and J. Anderson, Locking in Pfair-scheduled multiprocessor systems, Proceedings of the 23rd IEEE Real-time Systems Symposium, pp. 149-158, December 2002.

Page 24: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson24Multiprocessor Fair Scheduling

References (Continued)P. Holman and J. Anderson, Object sharing in Pfair-scheduled multiprocessor systems, Proceedings of the 14th Euromicro Conference on Real-time Systems, pp. 111-120, June 2002.

P. Holman and J. Anderson, Using hierarchal scheduling to improve resource utilization in multiprocessor real-time systems, Proceedings of the 15th Euromicro Conference on Real-time Systems, pp. 41-50, July 2003.

P. Holman and J. Anderson, Implementing Pfairness on a symmetric multiprocessor, Proceedings of the 10th IEEE Real-time and Embedded Technology and Applications Symposium, pp. 544-553, May 2004.

M. Moir and S. Ramamurthy, Pfair scheduling of fixed and migrating periodic tasks on multiple resources, Proceedings of the Twentieth IEEE Real-time Systems Symposium, pp. 294-303, December 1999.

A. Srinivasan, Efficient and Flexible Fair Scheduling of Real-time Tasks on Multiprocessors, Ph.D. Dissertation, University of North Carolina at Chapel Hill, December 2003.

Page 25: Jim Anderson 1 Multiprocessor Fair Scheduling The Case for Multiprocessor Fair Scheduling James H. Anderson University of North Carolina at Chapel Hill

Jim Anderson25Multiprocessor Fair Scheduling

References (Continued)A. Srinivasan and J. Anderson, Optimal rate-based scheduling on multiprocessors, Proceedings of the 34th ACM Symposium on Theory of Computing, pp. 189-198, May 2002.

A. Srinivasan and J. Anderson, Efficient scheduling of soft real-time applications on multiprocessors, Journal of Embedded Computing (to appear), special issue of best papers from the 15th Euromicro Conference on Real-time Systems, 2003. Preliminary version appeared in Proceedings of the 15th Euromicro Conference on Real-time Systems, pp. 51-59, July 2003.

A. Srinivasan and J. Anderson, Fair scheduling of dynamic task systems on multiprocessors, Journal of Systems and Software (to appear), special issue of best papers from the 11th International Workshop on Parallel and Distributed Real-time Systems, 2004.

A. Srinivasan, P. Holman, and J. Anderson, Integrating aperiodic and recurrent tasks on fair-scheduled multiprocessors, Proceedings of the 14th Euromicro Conference on Real-time Systems, pp. 19-28, June 2002.

A. Srinivasan, P. Holman, J. Anderson, and S. Baruah, The case for fair multiprocessor scheduling, Proceedings of the 11th International Workshop on Parallel and Distributed Real-time Systems, April 2003 (on CD ROM).