Dynamic Thread Scheduling on MP

Dynamic Thread Scheduling on MP-SoC
using Game Theory
Authors:
Pao-Ann Hsiung
Bo-HsuanWang
Embedded System Laboratory
Dept. of CSIE
National Chung Cheng University
Outline
 Introduction
 System Model
 Scheduling Algorithm
 Experimental Results
 Conclusions
2
Introduction
 More and more chip makers integrate multiple processing
elements (cores) into a single chip, this configuration is called
MP-SoC.
 MP-SoC provides us better processing performance to fit the
processing requirements, but it also imposes some challenges.
 We focus on the thread scheduling problems with the
dependence among threads in the MP-SoC, and solve it by the
Game Theory.
3
Outline
 Introduction
 System Model
 Scheduling Algorithm
 Experimental Results
 Conclusions
4
Behavior of threads
ENTER
LEAVE
READY
RUNNING
WAITING
5
Priority of threads
6
Priority
Time quantum
(cycles)
Select order
1
10
10th
2
20
9th
3
30
8rd
4
40
7th
5
50
6th
6
60
5th
7
70
4th
8
80
3rd
9
90
2nd
10
100
1st
Dependence of threads
0
Wait t1
t2
t3
t4
1
time
2
3
4
5
6
7
8
9
WSP (Wait Synchronization Point)
CSP (Complete Synchronization Point)
7
Complete
Scheduling Scenario
Scenario 1: t1, t2, t3 and t4 has fix priority with 3 cycles time quantum.
Core 1
t
1
0
t
3
1
t4
2
3
t4
4
5
6
t4
7
8
9
t1
t1
t1
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
36/24*2=75%
Core 2
t2
0
1
t3
2
3
4
5
6
t3
7
8
9
t3
t2
t2
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Scenario 2: t1 has 2, t2 has 1, t3 has 3 and t4 has 5 cycles time quantum.
Core 1
Core 2
8
t4
0
1
t
3
0
2
t
1
1
3
t
2
2
t
2
t4
4
5
4
7
t
2
t3
3
6
5
8
9
t3
6
7
t1
9
t1
t1
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
t3
8
t1
t
2
t
2
t
2
t
2
t
2
t
2
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
36/22*2=82%
Outline
 Introduction
 System Model
 Scheduling Algorithm
 Experimental Results
 Conclusions
9
Game-Theoretic Scheduling Algorithm
(GT)
 The Game-Theoretic scheduling algorithm (GT) is
composed by two parts:
 Game-theoretic Priority Decision
 Set the appropriate priorities for each threads using Game Theory.
 Dynamic Priority Adjusting
 Re-adjust the priorities of the threads when the system status change.
10
What strategies they
Game-theoretic
Priority Decision
can choose?
Who play this
game?
 G = { P , Si , ui }
How do they choose
strategies?
 P = { p1=thread1 , p2=thread2 , … , pn=threadn }
 Si = { si1=1 , si2=2 , …, si10=10 }
No. of CSPs you
complete

No. of WSPs you
wait
11
No. of time quantum
you execute more than
others
Dynamic priority Adjusting
Is a thread
enter or leave
Y
Game-theoretic
Priority Decision
Thread
Scheduling
12
N
Outline
 Introduction
 System Model
 Scheduling Algorithm
 Experimental Results
 Conclusions
13
Experimental Results
 In our experiments, we generate 20 threads with
 Random start time when they enter the system.
 Random execution time in 5000 to 10000 cycles.
 Random dependence.
14
Experimental Results (cont.)
15
Experimental Results (cont.)
16
Experimental Results
14%
17
7~8%
5%
Outline
 Introduction
 System Model
 Scheduling Algorithm
 Experimental Results
 Conclusions
18
Conclusions
 We propose a thread scheduling algorithm on the MP-SoC for a
set of threads with dependence using Game Theory.
 We can use our algorithm to dynamically adjust the priorities of
each thread when the system status is change.
 The results shows our algorithm provides shorter scheduling
turnaround time and higher cores utilization.
19
Thanks for Your Attention!
Bo-Hsuan Wang
Embedded System Laboratory
Dept. of CSIE
National Chung Cheng University
E-mail: [email protected]
Tel: (05)2720411 ext.33132
Cell phone: 0933232940
20
Game-theoretic Priority Decision
Wij
Number of WSPs that threadi wait for threadj
Cij
Number of CSPs that threadi complete threadj
T
Time quanta vector of all threads
T = [ t(s1) t(s2) … t(sn) ]T
where t(si) = si * 10 cycles
Ti
Time quanta vector of threadi
Ti = [ t(si) t(si) … t(si) ]T
where t(si) = si * 10 cycles
21
Game Theory
 Non-cooperative simultaneous game
 Each player individually chooses a strategy.
 Each player simultaneously chooses a strategy.
 Easy to implement.
 Nash Equilibrium
 For each pi, si* is pi’s best response to the strategies specified for
other players.
 ui(s1*, … , si*, … ,sn*) ≧ ui(s1*, ... ,si , ... , sn*)
22