Analyzing Lock Contention in Multithreaded Applications

被引:24
作者
Tallent, Nathan R. [1 ]
Mellor-Crummey, John M. [1 ]
Porterfield, Allan
机构
[1] Rice Univ, Houston, TX 77251 USA
关键词
Performance; Measurement; Algorithms; Performance Analysis; Lock Contention; Multithreading; HPCTOOLKIT;
D O I
10.1145/1837853.1693489
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Many programs exploit shared-memory parallelism using multithreading. Threaded codes typically use locks to coordinate access to shared data. In many cases, contention for locks reduces parallel efficiency and hurts scalability. Being able to quantify and attribute lock contention is important for understanding where a multithreaded program needs improvement. This paper proposes and evaluates three strategies for gaining insight into performance losses due to lock contention. First, we consider using a straightforward strategy based on call stack profiling to attribute idle time and show that it fails to yield insight into lock contention. Second, we consider an approach that builds on a strategy previously used for analyzing idleness in work-stealing computations; we show that this strategy does not yield insight into lock contention. Finally, we propose a new technique for measurement and analysis of lock contention that uses data associated with locks to blame lock holders for the idleness of spinning threads. Our approach incurs < 5% overhead on a quantum chemistry application that makes extensive use of locking (65M distinct locks, a maximum of 340K live locks, and an average of 30K lock acquisitions per second per thread) and attributes lock contention to its full static and dynamic calling contexts. Our strategy, implemented in HPCTOOLKIT, is fully distributed and should scale well to systems with large core counts.
引用
收藏
页码:269 / 279
页数:11
相关论文
共 24 条
  • [1] Anderson T. E., 1990, IEEE Transactions on Parallel and Distributed Systems, V1, P6, DOI 10.1109/71.80120
  • [2] ANDERSON TE, 1990, PERF E R SI, V18, P115, DOI 10.1145/98460.98518
  • [3] BACON D.F., 1998, PLDI 98, P258
  • [4] Bader DA, 2005, LECT NOTES COMPUT SC, V3769, P465
  • [5] Breshears C. P., 2007, USING INTEL THREAD P
  • [6] Butenhof DR., 1997, Programming with POSIX Threads
  • [7] Cepeda S., 2009, PERFORMANCE ANAL INT
  • [8] Chung M., MONITORING MANAGING
  • [9] *DARPA HIGH PROD C, SCAL SYNTH COMP APPL
  • [10] ProfileMe: Hardware support for instruction-level profiling on out-of-order processors
    Dean, J
    Hicks, JE
    Waldspurger, CA
    Weihl, WE
    Chrysos, G
    [J]. THIRTIETH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE, PROCEEDINGS, 1997, : 292 - 302