perf_counter: update mmap() counter read
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 2 Apr 2009 09:12:04 +0000 (11:12 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 6 Apr 2009 07:30:47 +0000 (09:30 +0200)
commit92f22a3865abe87eea2609a6f8e5be5123f7ce4f
tree4ded8d6858a4e50f0e3401e5e3f2a6c37fee8f58
parent5872bdb88a35fae7d224bd6b21e5f377e854ccfc
perf_counter: update mmap() counter read

Paul noted that we don't need SMP barriers for the mmap() counter read
because its always on the same cpu (otherwise you can't access the hw
counter anyway).

So remove the SMP barriers and replace them with regular compiler
barriers.

Further, update the comment to include a race free method of reading
said hardware counter. The primary change is putting the pmc_read
inside the seq-loop, otherwise we can still race and read rubbish.

Noticed-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Orig-LKML-Reference: <20090402091319.577951445@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/perf_counter.h
kernel/perf_counter.c
This page took 0.140708 seconds and 5 git commands to generate.