• Peter Zijlstra's avatar
    perf_counter: update mmap() counter read · 92f22a38
    Peter Zijlstra authored
    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: default avatarPaul Mackerras <paulus@samba.org>
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
    Orig-LKML-Reference: <20090402091319.577951445@chello.nl>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    92f22a38
perf_counter.c 72 KB