Understanding Energy Behaviors
of Thread Management Constructs
Gustavo Pinto1 Fernando Castor1 David Liu2
{ghlp, castor}@cin.ufpe.br1
[email protected]
Slide 2
Slide 2 text
2
• First, the proliferation of multicore CPUs
• Second, the prevalence of multi-threaded programs
Motivation
Slide 3
Slide 3 text
3
• First, more cores more power consumed
• Second, little is known about energy behaviors of
multi-threaded program on the application and
programming language level
The Problem
Slide 4
Slide 4 text
4
1. programming abstractions of thread management
on energy efficiency
2. programmer choices of thread management on
energy efficiency
This Talk
for Java multi-threaded programs
Slide 5
Slide 5 text
5
• Explicit threading (the Thread-style): Using the
java.lang.Thread class
• Thread pooling (the Executor-style): Using the
java.util.concurrent.Executor framework
• Working Stealing (the ForkJoin-style): Using the
java.util.concurrent.ForkJoin framework
Thread management
constructs
8
Experimental Environment
A 2×16-core AMD CPUs, running Debian
Linux, 64GB of memory, JDK version 1.7.0
11, build 21, “ondemand” governor
Slide 9
Slide 9 text
9
Experimental Environment
A 2×16-core AMD CPUs, running Debian
Linux, 64GB of memory, JDK version 1.7.0
11, build 21, “ondemand” governor
Slide 10
Slide 10 text
10
Experimental Environment
A 2×16-core AMD CPUs, running Debian
Linux, 64GB of memory, JDK version 1.7.0
11, build 21.
Slide 11
Slide 11 text
11
Experimental Environment
A 2×16-core AMD CPUs, running Debian
Linux, 64GB of DDR3 1600 memory, and
JDK version 1.7.0 11, build 21.
Slide 12
Slide 12 text
Energy Consumption When Varying the
Number of Threads
12
Slide 13
Slide 13 text
13
The Λ Curve
Slide 14
Slide 14 text
14
The Λ Curve
Slide 15
Slide 15 text
15
The Λ Curve
Slide 16
Slide 16 text
16
More cores idle
CPU frequency
at a lower level
The Λ Curve
Slide 17
Slide 17 text
17
More cores idle
CPU frequency
at a lower level
More threads used,
program completes sooner
The greater the ratio
between speedup and
power, the steeper the \
The Λ Curve
Slide 18
Slide 18 text
Which programming style should I use?
18
?
?
Slide 19
Slide 19 text
Overpopulating Cores with Threads
19
Slide 20
Slide 20 text
Overpopulating Cores with Threads
20
Slide 21
Slide 21 text
Faster ≠ Greener
21
Slide 22
Slide 22 text
Copying vs Sharing
22
Slide 23
Slide 23 text
Copying vs Sharing
23
Copying
Slide 24
Slide 24 text
Copying vs Sharing
24
Copying
Sharing
Slide 25
Slide 25 text
Copying vs Sharing
25
Copying
Sharing
±15% of energy savings!
Slide 26
Slide 26 text
26
Copy-Fork
Slide 27
Slide 27 text
27
After
Before
Copy-Fork
Slide 28
Slide 28 text
28
After
Before
Copy-Fork
Copy/Fork/Copy/Fork/…
Slide 29
Slide 29 text
29
After
Before
Copy-Fork
Copy/Fork/Copy/Fork/…
Slide 30
Slide 30 text
30
After
Before
Copy-Fork
Copy/Fork/Copy/Fork/…
Copy/../Copy/Fork/…/Fork
Slide 31
Slide 31 text
31
After
Before
Copy-Fork
±10% of energy
savings!
Copy/Fork/Copy/Fork/…
Copy/../Copy/Fork/…/Fork
Slide 32
Slide 32 text
Data Size
32
Slide 33
Slide 33 text
Data Size
33
For most of the cases, energy
consumption is linear to data
size!
Slide 34
Slide 34 text
34
Slide 35
Slide 35 text
35
Slide 36
Slide 36 text
36
Slide 37
Slide 37 text
37
Slide 38
Slide 38 text
Understanding Energy Behaviors
of Thread Management Constructs
Gustavo Pinto1 Fernando Castor1 David Liu2
{ghlp, castor}@cin.ufpe.br1
[email protected]