Skip to main content

Lowering STM Overhead with Static Analysis

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6548))

Abstract

Software Transactional Memory (STM) compilers commonly instrument memory accesses by transforming them into calls to STM library functions. Done naïvely, this instrumentation imposes a large overhead, slowing down the transaction execution. Many compiler optimizations have been proposed in an attempt to lower this overhead. In this paper we attempt to drive the STM overhead lower by discovering sources of sub-optimal instrumentation, and providing optimizations to eliminate them. The sources are: (1) redundant reads of memory locations that have been read before, (2) redundant writes to memory locations that will be subsequently written to, (3) redundant writeset lookups of memory locations that have not been written to, and (4) redundant writeset record-keeping for memory locations that will not be read. We describe how static analysis and code motion algorithms can detect these sources, and enable compile-time optimizations that significantly reduce the instrumentation overhead in many common cases. We implement the optimizations over a TL2 Java-based STM system, and demonstrate the effectiveness of the optimizations on various benchmarks, measuring up to 29-50% speedup in a single-threaded run, and up to 19% increased throughput in a 32-threads run.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. http://demsky.eecs.uci.edu/software.php

  2. Adl-Tabatabai, A.-R., Lewis, B.T., Menon, V., Murphy, B.R., Saha, B., Shpeisman, T.: Compiler and runtime support for efficient software transactional memory. In: PLDI 2006: Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 26–37. ACM, New York (2006) ISBN 1-59593-320-4, doi http://doi.acm.org/10.1145/1133981.1133985

    Chapter  Google Scholar 

  3. Agrawal, K., Leiserson, C.E., Sukha, J.: Memory models for open-nested transactions. In: MSPC 2006: Proceedings of the 2006 Workshop on Memory System Performance and Correctness, pp. 70–81. ACM, New York (2006) ISBN 1-59593-578-9, doi http://doi.acm.org/10.1145/1178597.1178610

    Chapter  Google Scholar 

  4. Barik, R., Sarkar, V.: Interprocedural load elimination for dynamic optimization of parallel programs. In: PaCT 2009, pp. 41–52. IEEE Computer Society, Los Alamitos (2009) ISBN 978-0-7695-3771-9, doi http://dx.doi.org/10.1109/PACT.2009.32

  5. Beckman, N.E., Kim, Y.P., Stork, S., Aldrich, J.: Reducing STM overhead with access permissions. In: IWACO 2009: International Workshop on Aliasing, Confinement and Ownership in Object-Oriented Programming, pp. 1–10. ACM, New York (2009) ISBN 978-1-60558-546-8, doi http://doi.acm.org/10.1145/1562154.1562156

    Chapter  Google Scholar 

  6. Bruneton, E., Lenglet, R., Coupaye, T.: ASM: A code manipulation tool to implement adaptable systems. In: Adaptable and Extensible Component Systems (2002)

    Google Scholar 

  7. Cao Minh, C., Chung, J., Kozyrakis, C., Olukotun, K.: STAMP: Stanford transactional applications for multi-processing. In: IISWC 2008: Proceedings of The IEEE International Symposium on Workload Characterization (September 2008)

    Google Scholar 

  8. Cascaval, C., Blundell, C., Michael, M., Cain, H.W., Wu, P., Chiras, S., Chatterjee, S.: Software transactional memory: why is it only a research toy? Commun. ACM 51(11), 40–46 (2008) ISSN 0001-0782, doi http://doi.acm.org/10.1145/1400214.1400228

    Article  Google Scholar 

  9. Demsky, B., Dash, A.: Evaluating contention management using discrete event simulation. In: Fifth ACM SIGPLAN Workshop on Transactional Computing (April 2010)

    Google Scholar 

  10. Dice, D., Shalev, O., Shavit, N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  11. Dragojevic, A., Ni, Y., Adl-Tabatabai, A.-R.: Optimizing transactions for captured memory. In: SPAA 2009: Proceedings of the Twenty-first Annual Symposium on Parallelism in Algorithms and Architectures, pp. 214–222. ACM, New York (2009) ISBN 978-1-60558-606-9, doi http://doi.acm.org/10.1145/1583991.1584049

    Chapter  Google Scholar 

  12. Eddon, G., Herlihy, M.: Language support and compiler optimizations for STM and transactional boosting. In: Janowski, T., Mohanty, H. (eds.) ICDCIT 2007. LNCS, vol. 4882, pp. 209–224. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  13. Fink, S.J., Knobe, K., Sarkar, V.: Unified analysis of array and object references in strongly typed languages. In: SAS 2000. LNCS, vol. 1824, pp. 155–174. Springer, Heidelberg (2000) ISBN 3-540-67668-6

    Chapter  Google Scholar 

  14. Harris, T., Plesko, M., Shinnar, A., Tarditi, D.: Optimizing memory transactions. In: Conference on Programming Language Design and Implementation. ACM SIGPLAN, pp. 14–25 (June 2006)

    Google Scholar 

  15. Herlihy, M., Eliot, J., Moss, B.: Transactional memory: Architectural support for lock-free data structures. In: Proceedings of the 20th Annual International Symposium on Computer Architecture, pp. 289–300 (1993)

    Google Scholar 

  16. Hosking, A.L., Nystrom, N., Whitlock, D., Cutts, Q.I., Diwan, A.: Partial redundancy elimination for access path expressions. In: Proceedings of the Workshop on Object-Oriented Technology, London, UK, pp. 138–141. Springer, Heidelberg (1999) ISBN 3-540-66954-X

    Google Scholar 

  17. Kennedy, K., Allen, J.R.: Optimizing compilers for modern architectures: a dependence-based approach. Morgan Kaufmann Publishers Inc., San Francisco (2002) ISBN 1-55860-286-0

    Google Scholar 

  18. Knoop, J., Rüthing, O., Steffen, B.: Lazy code motion. SIGPLAN Not. 27(7), 224–234 (1992) ISSN 0362-1340, doi http://doi.acm.org/10.1145/143103.143136

    Article  Google Scholar 

  19. Korland, G., Shavit, N., Felber, P.: Noninvasive concurrency with Java STM. In: MultiProg 2010: Programmability Issues for Heterogeneous Multicores (January 2010), http://www.deucestm.org/

  20. Lu, J., Cooper, K.D.: Register promotion in C programs. In: PLDI 1997: Proceedings of the ACM SIGPLAN 1997 Conference on Programming Language Design and Implementation, pp. 308–319. ACM, New York (1997) ISBN 0-89791-907-6, doi http://doi.acm.org/10.1145/258915.258943

    Chapter  Google Scholar 

  21. Martin, M., Blundell, C., Lewis, E.: Subtleties of transactional memory atomicity semantics. IEEE Comput. Archit. Lett. 5(2), 17 (2006) ISSN 1556-6056, doi http://dx.doi.org/10.1109/L-CA.2006.18

    Google Scholar 

  22. Morel, E., Renvoise, C.: Global optimization by suppression of partial redundancies. Commun. ACM 22(2), 96–103 (1979) ISSN 0001-0782, doi http://doi.acm.org/10.1145/359060.359069

    Article  MathSciNet  MATH  Google Scholar 

  23. Ni, Y., Welc, A., Adl-Tabatabai, A.-R., Bach, M., Berkowits, S., Cownie, J., Geva, R., Kozhukow, S., Narayanaswamy, R., Olivier, J., Preis, S., Saha, B., Tal, A., Tian, X.: Design and implementation of transactional constructs for C/C++. In: OOPSLA 2008: Proceedings of the 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, pp. 195–212 (2008)

    Google Scholar 

  24. Shavit, N., Touitou, D.: Software transactional memory. In: Proc. of the 12th Annual ACM Symposium on Principles of Distributed Computing (PODC), pp. 204–213 (1995)

    Google Scholar 

  25. Shpeisman, T., Menon, V., Adl-Tabatabai, A.-R., Balensiefer, S., Grossman, D., Hudson, R.L., Moore, K.F., Saha, B.: Enforcing isolation and ordering in stm. SIGPLAN Not. 42(6), 78–88 (2007) ISSN 0362-1340, doi http://doi.acm.org/10.1145/1273442.1250744

    Article  Google Scholar 

  26. So, B., Hall, M.W.: Increasing the applicability of scalar replacement. In: CC, pp. 185–201 (2004)

    Google Scholar 

  27. Spear, M.F., Michael, M.M., Scott, M.L., Wu, P.: Reducing memory ordering overheads in software transactional memory. In: CGO 2009: Proceedings of the 7th Annual IEEE/ACM International Symposium on Code Generation and Optimization, Washington, DC, USA, pp. 13–24. IEEE Computer Society, Los Alamitos (2009) ISBN 978-0-7695-3576-0, doi http://dx.doi.org/10.1109/CGO.2009.30

    Chapter  Google Scholar 

  28. von Praun, C., Schneider, F., Gross, T.R.: Load elimination in the presence of side effects, concurrency and precise exceptions. In: Rauchwerger, L. (ed.) LCPC 2003. LNCS, vol. 2958, pp. 390–405. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  29. Wang, C., Chen, W.-Y., Wu, Y., Saha, B., Adl-Tabatabai, A.-R.: Code generation and optimization for transactional memory constructs in an unmanaged language. In: CGO 2007: Proceedings of the International Symposium on Code Generation and Optimization, Washington, DC, USA, pp. 34–48. IEEE Computer Society, Los Alamitos (2007) ISBN 0-7695-2764-7, doi http://dx.doi.org/10.1109/CGO.2007.4

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Afek, Y., Korland, G., Zilberstein, A. (2011). Lowering STM Overhead with Static Analysis. In: Cooper, K., Mellor-Crummey, J., Sarkar, V. (eds) Languages and Compilers for Parallel Computing. LCPC 2010. Lecture Notes in Computer Science, vol 6548. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-19595-2_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-19595-2_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-19594-5

  • Online ISBN: 978-3-642-19595-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics