03-Presentation_rika..

Download Report

Transcript 03-Presentation_rika..

SCHEDULING FOR
PARALLELISM
RIKA NAKAHARA, YIXIN LUO
AGENDA
• What is Scheduling?
• Contention for resources
•
•
•
•
Core/CPU time
LLC
I/Os and Prefetcher
Locks and Shared Data
• Metric
• Throughput
• Quality of Service
WHAT IS SCHEDULING?
• In computer science, scheduling is the method by
which threads, processes or data flows are given
access to system resources (e.g. processor time,
communications bandwidth)
- Wikipedia
• Why scheduling for parallelism?
task
1
task
2
…
Single
Core
Processor
task
n
task
1
task
2
Core 1
…
task
n
Core 2
Reference: http://en.wikipedia.org/wiki/Scheduling_(computing)
CONTENTION FOR RESOURCES
•
•
•
•
Core/CPU time
LLC
I/Os and Prefetcher
Locks and Shared Data
Core 1
Core 2
L1$
L1$
L2$
L2$
• Solution?
LLC
Mem Ctl.
Lock A
Memory
HOW TO SCHEDULE FOR…
• 100 threads contending for 64 cores and locks?
• Running thread spinning on lock?
• Put some threads to longer sleep.
• Sleeping thread holding the lock?
• Multiple cores sharing LLC and memory bus?
• Cache Pollution?
• How to pick programs to run together?
• An SMT processor?
• How to determine which threads to co-schedule?
METRIC
• There is usually tradeoff between throughput and
QoS.
• Quality of service:
• Latency/Turnaround time
• Fairness
Runtime(Multithread)
< Noticeable to user
Runtime(Singlethread)
ADDRESSING SHARED RESOURCE CONTENTION IN
MULTICORE PROCESSORS VIA SCHEDULING
• Scheduling = classification & algorithm
• Classification: SDC, Animal, Miss Rate, Pain
• Algorithm: distribute program with high memory
access
 determine which 2 applicable to pair together in one core
Sergey Zhuravlev, Sergey Blagodurov, and Alexandra Fedorova. 2010. Addressing shared resource contention in multicore processors via scheduling. In Proceedings of the fifteenth edition of ASPLOS on
Architectural support for programming languages and operating systems(ASPLOS '10). ACM, New York, NY, USA, 129-142. DOI=10.1145/1736020.1736036 http://doi.acm.org/10.1145/1736020.1736036
PROBABILISTIC JOB SYMBIOSIS MODELING
FOR SMT PROCESSOR SCHEDULING
• Co-scheduling: running multiple threads together
• Model-driven scheduling: estimate model based on
wait cycle and dynamically recalculate coscheduling
Stijn Eyerman and Lieven Eeckhout. 2010. Probabilistic job symbiosis modeling for SMT processor scheduling. In Proceedings of the fifteenth edition of ASPLOS on Architectural support for programming
languages and operating systems (ASPLOS '10). ACM, New York, NY, USA, 91-102. DOI=10.1145/1736020.1736033 http://doi.acm.org/10.1145/1736020.1736033
DECOUPLING CONTENTION
MANAGEMENT FROM SCHEDULING
• Increasing load diminishes effect of spinning and
blocking.
• Decoupling load management and scheduling
F. Ryan Johnson, Radu Stoica, Anastasia Ailamaki, and Todd C. Mowry. "Decoupling contention management from scheduling," in Proceedings of the Ffteenth edition of ASPLOS on Architectural support
for programming languages and operating systems (ASPLOS '10).
FLEXIBLE ARCHITECTURAL SUPPORT
FOR FINE-GRAIN SCHEDULING
• Bypass shared resource contention by message
passing
Daniel Sanchez, Richard M. Yoo, and Christos Kozyrakis. "Flexible architectural support for Fne-grain scheduling," in Proceedings of the Ffteenth edition of ASPLOS on Architectural support for programming
languages and operating systems (ASPLOS '10).