skip to main content
research-article

Dynamic optimization for efficient strong atomicity

Published:19 October 2008Publication History
Skip Abstract Section

Abstract

Transactional memory (TM) is a promising concurrency control alternative to locks. Recent work has highlighted important memory model issues regarding TM semantics and exposed problems in existing TM implementations. For safe, managed languages such as Java, there is a growing consensus towards strong atomicity semantics as a sound, scalable solution. Strong atomicity has presented a challenge to implement efficiently because it requires instrumentation of non-transactional memory accesses, incurring significant overhead even when a program makes minimal or no use of transactions. To minimize overhead, existing solutions require either a sophisticated type system, specialized hardware, or static whole-program analysis. These techniques do not translate easily into a production setting on existing hardware. In this paper, we present novel dynamic optimizations that significantly reduce strong atomicity overheads and make strong atomicity practical for dynamic language environments. We introduce analyses that optimistically track which non-transactional memory accesses can avoid strong atomicity instrumentation, and we describe a lightweight speculation and recovery mechanism that applies these analyses to generate speculatively-optimized but safe code for strong atomicity in a dynamically-loaded environment. We show how to implement these mechanisms efficiently by leveraging existing dynamic optimization infrastructure in a Java system. Measurements on a set of transactional and non-transactional Java workloads demonstrate that our techniques substantially reduce the overhead of strong atomicity from a factor of 5x down to 10% or less over an efficient weak atomicity baseline.

References

  1. ABADI, M., BIRRELL, A., HARRIS, T., AND ISARD, M. Semantics of transactional memory and automatic mutual exclusion. In POPL 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. ADL-TABATABAI, A.-R., LEWIS, B. T., MENON, V. S., MURPHY, B. R., SAHA, B., AND SHPEISMAN, T. Compiler and runtime support for efficient software transactional memory. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. BLUNDELL, C., LEWIS, E. C., AND MARTIN, M. Subtleties of transactional memory atomicity semantics. Computer Architecture Letters 5, 2 (Nov. 2006). Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. BORISOV, N., JOHNSON, R., SASTRY, N., AND WAGNER, D. Fixing races for fun and profit: how to abuse atime. In SSYM 2005 (Berkeley, CA, USA, 2005), USENIX Association, pp. 20--20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. BOYAPATI, C., LEE, R., AND RINARD, M. Ownership types for safe programming: preventing data races and deadlocks. In OOPSLA 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. BOYAPATI, C., SALCIANU, A., WILLIAM BEEBEE, J., AND RINARD, M. Ownership types for safe region-based memory management in real-time Java. In PLDI 2003 (2003). Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. CHOI, J.-D., GUPTA, M., SERRANO, M. J., SREEDHAR, V. C., AND MIDKIFF, S. P. Stack allocation and synchronization optimizations for Java using escape analysis. ACM Trans. Program. Lang. Syst. 25, 6 (2003). Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. CHOI, J.-D., LEE, K., LOGINOV, A., O'CALLAHAN, R., SARKAR, V., AND SRIDHARAN, M. Efficient and precise datarace detection for multithreaded object-oriented programs. In PLDI 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. CLARKE, D., RICHMOND, M., AND NOBLE, J. Saving the world from bad beans: deployment-time confinement checking. In OOPSLA 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. CLARKE, D. G., POTTER, J. M., AND NOBLE, J. Ownership types for flexible alias protection. In OOPSLA 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. DEAN, J., GROVE, D., AND CHAMBERS, C. Optimization of object-oriented programs using static class hierarchy analysis. In ECOOP 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. DOLBY, J., AND CHIEN, A. An automatic object inlining optimization and its evaluation. In PLDI 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. GROSSMAN, D., MANSON, J., AND PUGH, W. What do high-level memory models mean for transactions? In MSPC 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. HARRIS, T., AND FRASER, K. Language support for lightweight transactions. In OOPSLA 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. HARRIS, T., MARLOW, S., JONES, S. P., AND HERLIHY, M. Composable memory transactions. In PPoPP 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. HARRIS, T., PLESKO, M., SHINNAR, A., AND TARDITI, D. Optimizing memory transactions. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. HEINE, D. L., AND LAM, M. S. A practical flow-sensitive and context-sensitive C and C++ memory leak detector. In PLDI 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. HERLIHY, M., AND MOSS, J. E. B. Transactional memory: architectural support for lock-free data structures. In ISCA 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. HINDMAN, B., AND GROSSMAN, D. Atomicity via source-to-source translation. In MSPC 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. HINDMAN, B., AND GROSSMAN, D. Strong atomicity for Java without virtual-machine support. Tech. Rep. UW-CSE-06-05-01, May 2006.Google ScholarGoogle Scholar
  21. INTEL CORPORATION. Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide.Google ScholarGoogle Scholar
  22. ISHIZAKI, K., KAWAHITO, M., YASUE, T., KOMATSU, H., AND NAKATANI, T. A study of devirtualization techniques for a Java just-in-time compiler. In OOPSLA 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. KOTZMANN, T., AND MOSSENBOCK, H. Escape analysis in the context of dynamic compilation and deoptimization. In VEE 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. LHOTA K, O., AND HENDREN, L. Run-time evaluation of opportunities for object inlining in Java. In JGI '02: Proc. of the conf. on Java Grande. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. MENON, V., BALENSIEFER, S., SHPEISMAN, T., ADLTABATABAI, A.-R., HUDSON, R. L., SAHA, B., AND WELC, A. Practical weak-atomicity semantics for Java STM. In SPAA 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. MOORE, K. F., AND GROSSMAN, D. High-level small-step operational semantics for transactions. In POPL 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. NAIK, M., AIKEN, A., AND WHALEY, J. Effective static race detection for Java. In PLDI 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. PECHTCHANSKI, I., AND SARKAR, V. Dynamic optimistic interprocedural analysis: a framework and an application. In OOPSLA 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. SAVAGE, S., BURROWS, M., NELSON, G., SOBALVARRO, P., AND ANDERSON, T. Eraser: a dynamic data race detector for multi-threaded programs. In SOSP 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. SHPEISMAN, T., MENON, V., ADL-TABATABAI, A.-R., BALENSIEFER, S., GROSSMAN, D., HUDSON, R. L., MOORE, K. F., AND SAHA, B. Enforcing isolation and ordering in STM. In PLDI 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. STANDARD PERFORMANCE EVALUATION CORPORATION. SPEC JVM98, 1998. See http://www.spec.org/jvm98.Google ScholarGoogle Scholar
  32. STANDARD PERFORMANCE EVALUATION CORPORATION. SPEC JBB2000, 2000. See http://www.spec.org/jbb2000.Google ScholarGoogle Scholar
  33. VITEK, J., AND BOKOWSKI, B. Confined types. In OOPSLA 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. VIVIEN, F., AND RINARD, M. Incrementalized pointer and escape analysis. In PLDI 2001 (2001). Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. VON PRAUN, C., AND GROSS, T. R. Object race detection. In OOPSLA 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. VON PRAUN, C., AND GROSS, T. R. Static conflict analysis for multi-threaded object--oriented programs. In PLDI 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. WIMMER, C., AND MOSSENBOCK, H. Automatic feedback directed object inlining in the Java Hotspot virtual machine. In VEE 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Dynamic optimization for efficient strong atomicity

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!