You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2016/05/09 19:08:46 UTC

[kudu-CR] Add metrics for tcmalloc spinlock contention

Hello Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/3007

to review the following change.

Change subject: Add metrics for tcmalloc spinlock contention
......................................................................

Add metrics for tcmalloc spinlock contention

tcmalloc uses a similar spinlock implementation to ours and supports reporting
contention metrics using the same weak symbol scheme. We previously did not
hook up tcmalloc's contention profiling to our own method due to a reentrancy
issue: tcmalloc can hit contention while it holds a heap-wide lock, which then
causes a deadlock if the profiling mechanism allocates memory.

This patch hooks it up to a very light-weight (allocation-free) profiling path
which adds the contention as a trace metric and a global counter metric. The
trace metric is slightly hacky since we can't safely use std::map in a context
where allocation is disallowed, but I think this metric is valuable enough to
be worth the hack.

Change-Id: I2f6ed322541b161e6d9e347e0d75e62d1b6b05ec
---
M src/kudu/util/spinlock_profiling-test.cc
M src/kudu/util/spinlock_profiling.cc
M src/kudu/util/spinlock_profiling.h
M src/kudu/util/trace_metrics.h
4 files changed, 73 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/07/3007/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3007
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f6ed322541b161e6d9e347e0d75e62d1b6b05ec
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>