Research Report RT0950

We presented a revised version of this research report in PPoPP 2014. The paper and slides are available here.

Eliminating Global Interpreter Locks in Ruby through Hardware Transactional Memory.
Rei Odaira and Jose G. Castanos.
Research Report RT0950, IBM Research - Tokyo, 2013

Full text [PDF]: RT0950_EliminatingRubyGILthroughHTM.pdf
Slides in English [PDF]: RT0950_EliminatingRubyGILthroughHTM_Slides_en.pdf
Slides in Japanese [PDF]: RT0950_EliminatingRubyGILthroughHTM_Slides_ja.pdf

Abstract

Many scripting languages use Global Interpreter Locks (GIL) to simplify the internal designs of their interpreters, but this kind of lock severely lowers the multi-thread performance on multi-core machines. This paper shows the first results eliminating the GIL in Ruby using the Hardware Transactional Memory (HTM) in the new mainframe zEnterprise EC12 processor. Though prior prototypes replaced the GIL with HTM, we tested realistic programs, the Ruby NAS Parallel Benchmarks (NPB), as well as micro-benchmarks. We devised a new technique to dynamically adjust the transaction lengths on a per-bytecode basis, so that we can automatically optimize the likelihood of transaction aborts against the relative overhead of the instructions to begin and end the transactions. Our current results show that HTM achieved an 11-fold speed-up over the GIL on 12 cores in the micro-benchmarks and 1.9- to 4.4-fold speed-ups in the NPB programs. The dynamic transaction-length adjustment improved the throughput by up to 18%. Our investigation on the scalability and overhead revealed further optimization opportunities.