Lock Inference for Java
Khilan Gudka Imperial College London Supervised by Professor Susan Eisenbach, Imperial College London Professor Sophia Drossopoulou, Imperial College London This work was generously funded by Microsoft Research Cambridge
1
Lock Inference for Java Khilan Gudka Imperial College London - - PowerPoint PPT Presentation
Lock Inference for Java Khilan Gudka Imperial College London Supervised by Professor Susan Eisenbach, Imperial College London Professor Sophia Drossopoulou, Imperial College London This work was generously funded by Microsoft Research
Khilan Gudka Imperial College London Supervised by Professor Susan Eisenbach, Imperial College London Professor Sophia Drossopoulou, Imperial College London This work was generously funded by Microsoft Research Cambridge
1
2
3
4
5
compiled to
6
7
8
9
Prior work
This work
10
11
12
Name #Threads #Atomics #client methods #lib methods LOC (client) sync 8 2 1177 pcmab 50 2 2 15 457 bank 8 8 6 7 269 traffic 2 24 4 63 2128 mtrt 2 6 67 1324 11312 hsqldb 20 240 2107 2955 301971
13
Name Paths Locks Total sync 0.122s 0.14s 5m 31s pcmab 0.246s 0.092s 5m 15s bank 0.247s 0.129s 5m 27s traffic 1.695s 0.2s 5m 40s mtrt 1h 30m 8.579s 1h 36m hsqldb ? ? ?
14
– Primitives for state
Encode analysis state as sets of longs for efficiency. All subsequent optimisations assume this
– Parallel propagation
– Summarising CFGs
– Worklist Ordering
predecessor nodes. This helps reduce redundant propagation
– Deltas
15
16
Name Paths Locks Total sync 0.122s 0.14s 5m 31s pcmab 0.246s 0.092s 5m 15s bank 0.247s 0.129s 5m 27s traffic 1.695s 0.2s 5m 40s mtrt 1h 30m 8.579s 1h 36m hsqldb 6h 6m 22m 6h 38m
Benchmark Manual Global Us Us vs Manual sync 69.14s 71.22 74.61s 1.08x pcmab 2.28s 3.15 12.47s 5.47x bank 20.89s 19.50 30.88s 1.47x traffic 2.56s 4.22 91.42s 35.71x mtrt 0.80s 0.82 0.95s 1.19x hsqldb 3.25s 3.12 500s 153.85x
17
18
Lock optimisation Type of analysis Runtime slowdown vs. manual locking Single-threaded lock elision Dynamic 1.10x – 16.13x Thread-local Static 1.09x – 14.84x Instance-local Static 1.13x – 13.16x Class-local Static 1.14x – 15.32x Method-local Static 1.14x – 15.05x Dominated Static 1.14x – 15.47x Read-only Static 1.14x – 13.26x
19
Benchmark Manual Global Us (no opt.) Us (all opt.) Us vs Manual Us vs Global sync 69.14s 71.22s 74.61s 56.61s 0.82x 0.79x pcmab 2.28s 3.15s 12.47s 2.47s 1.08x 0.78x bank 20.89s 19.50s 30.88s 3.88s 0.19x 0.20x traffic 2.56s 4.22s 91.42s 4.42s 1.73x 1.05x mtrt 0.80s 0.82s 0.95s 0.85s 1.06x 1.04x hsqldb 3.25s 3.12s 500s 11.39s 3.50x 3.65x
20