From: Peter Zijlstra Date: Wed, 13 May 2009 14:21:38 +0000 (+0200) Subject: perf_counter: Rework the perf counter disable/enable X-Git-Tag: v2.6.31-rc1~383^2~276 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e35ad388bea89f7d6f375af4c0ae98803688666;p=pandora-kernel.git perf_counter: Rework the perf counter disable/enable The current disable/enable mechanism is: token = hw_perf_save_disable(); ... /* do bits */ ... hw_perf_restore(token); This works well, provided that the use nests properly. Except we don't. x86 NMI/INT throttling has non-nested use of this, breaking things. Therefore provide a reference counter disable/enable interface, where the first disable disables the hardware, and the last enable enables the hardware again. [ Impact: refactor, simplify the PMU disable/enable logic ] Signed-off-by: Peter Zijlstra Cc: Paul Mackerras Cc: Corey Ashford LKML-Reference: Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed