Transactional Garbage
and how to collect it for fun and profit
Fadi Meawad Ryan Macnak Jan Vitek
S3Lab Computer Science Dept Purdue University
1
Transactional Garbage and how to collect it for fun and profit - - PowerPoint PPT Presentation
Transactional Garbage and how to collect it for fun and profit Fadi Meawad Ryan Macnak Jan Vitek S3Lab Computer Science Dept Purdue University 1 % of time spent in GC C# STMBench7 on Bartok # of threads 8-core, 1.60GHz Intel Xeon
Fadi Meawad Ryan Macnak Jan Vitek
S3Lab Computer Science Dept Purdue University
1
% of time spent in GC # of threads
C# STMBench7 on Bartok
8-core, 1.60GHz Intel Xeon E5310. 8GB RAM. Physical Address Extension enabled, running Windows Server 2003 SP2.
2
% of time spent in GC # of threads
C# STMBench7 on Bartok
8-core, 1.60GHz Intel Xeon E5310. 8GB RAM. Physical Address Extension enabled, running Windows Server 2003 SP2.
2
3
Let’s Benchmark
GCBench
Wormbench
matrix with other worms
4
4
Let’s Benchmark
STMBench7
LeeTM
intersecting paths.
5
5
C# GCBench
list size
slow down
8-core, 1.60GHz Intel Xeon E5310. 8GB RAM. Physical Address Extension enabled. Windows Server 2003 SP2.
6
Where did that time go?
!"" #"" $"" %"" &"" '"" ("" )"" !
"* +* #$* $'* %)* &%* '!* '(*
#
!#* $&* &'* '+* (%* )#* )&* ))*
$
#&* &$* (#* (+* )(* +!* +$* +&*
%
$+* ''* )!* ))* +#* +&* +'* +(*
&
%"* (&* )(* +#* +&* +'* +(* +)*
'
%+* )!* +"* +&* +(* +)* +)* ++*
(
'"* )#* +$* +'* +(* +)* ++* ++*
)
'%* )&* +%* +(* +)* ++* ++* ++*
C# GCBench, % of time spent in GC
# of threads
list size
7
8
What is Bartok STM?
Optimizing ahead-of-time research compiler & runtime STM
GC
[Harris, Plesko, Shinnar, Tarditi, Optimizing memory transactions, PLDI06] 9
9
GC % using Multiverse
!"#$"%&' ()*+,-./#. !"#$"%&' ()*+,-./#.
123 043
05 44
0647
8
9:3 ;83
02 01<
86:7
;
<:3 ;23
85 021
;617
1
<03 183
;0 852
8647
9
:93 123
;8 819
;6<7
<
:53 9:3
10 ;02
1617
:
213 <<3
11 195
<627
2
213 :<3
1: :<4
086<7
=>3 ?@+A*B+,C.BD#.%@"'#E F*@G'@G"
Java GCBench size 800, % of time spent in GC
10
GC % using Multiverse
!"#$"%&' ()*+,-./#. !"#$"%&' ()*+,-./#.
123 043
05 44
0647
8
9:3 ;83
02 01<
86:7
;
<:3 ;23
85 021
;617
1
<03 183
;0 852
8647
9
:93 123
;8 819
;6<7
<
:53 9:3
10 ;02
1617
:
213 <<3
11 195
<627
2
213 :<3
1: :<4
086<7
=>3 ?@+A*B+,C.BD#.%@"'#E F*@G'@G"
Java GCBench size 800, % of time spent in GC
10
Does it depend on the GC?
# of threads execution time (seconds)
GCBench, size 600
11
Does the problem Scale?
# of threads execution time (seconds)
Azul Vega 3 3310B, two 54-core processors. 48GB of RAM, Azul VM. Concurrent Pauseless GC
GCBench size 800, Azul
12
Does the problem Scale?
# of threads memory usage (GB)
GCBench size 800, Azul
13
14
899:%,&'&; <=%.&'&67 +,-. 4>?@?ABCDE@F 86#"%*"5% $6.7,$-/
Transaction manager Offset in log chunk 00 v90 Value = 10 Next = null Node VTable 00 v100 Head Tail List VTable 00 1 Sum = 42 List: Updated-object log entry: Node1:
Logs in Bartok
Object-based in place updates with undo logs Reads The read-object log contains read STM Word (version #) Updates An object opened for update has an updated-object log entry (previous STM word) Upon update, old value is maintained in an undo log Chunks Logs are allocated in chunks maintained by the STM Discarded at end of transaction
[Harris, Plesko, Shinnar, Tarditi, Optimizing memory transactions, PLDI 06]
1$(#2")3$4.% *"5%$6.7,$-/ !"#$0 )) .()) )
15
Log Reuse
rather than leave for GC
pool first, otherwise allocate
Issues
large unused pool
What is log reuse, and is it enough?
16
16
Dedicated Nurseries
Generational-GC nurseries
Transaction nurseries
threads until commit
17
17
18
Dedicated Nurseries
18
freelist
Dedicated Heap
19
19
Dedicated Heap
20
Does it work?
!$# !%# # %# $# "# &# '# %## $## "## &## '## (## )## *## %+,-./012
$
$ "
" & & ' ' ( ( )
C# GCBench
8-core, 1.60GHz Intel Xeon E5310. 8GB RAM. Physical Address Extension enabled, Windows Server 2003 SP2.
% total speedup
list size
21
Does it work?
C# STMBench7
# of threads
22
!"# "# $# %# &# '# ""# "$# "%# "&# "'# ("# " ( $ ) % * & + ,-./0123452637605.38759 ,-./0123452637609:638759
Does it work?
C# STMBench7
# of threads % increase in ops per second
23
LeeTM, issues
Issues
access (excessive logging)
Workarounds
24
24
Results (cont’d)
!" #!" $!" %!" &!" '!!" '#!" '" #" (" $" )" %" *" &" +,-./010234" +,-,560786" .9:-./010234" .9:-,560786" .9:+,-./010234" .9:+,-,560786" +,-./010234" +,-,560786" +,-,560786" .9:-./010234" .9:-,560786" .9:+,-./010234" .9:+,-,560786"
C# LeeTM
# of threads total time (seconds)
25
Results (cont’d)
# "# $# %# &# '# (# )# " $ % & ' ( ) * +,- .,-/0 /0 .,-/0 /0 .,-/0 /0 +,-
Running on an 8-core, 1.60GHz Intel Xeon E5310 with 8GB of RAM and Physical Address Extension enabled, running Windows Server 2003 SP2.C# LeeTM
# of threads % of time saved
26
Conclusion
Memory Usage
Speed Up Applying to other systems
support will work with most STM flavors
27
27