From: Peter Zijlstra Date: Fri, 1 May 2009 10:23:16 +0000 (+0200) Subject: perf_counter: fix race in perf_output_* X-Git-Tag: v2.6.31-rc1~383^2~317 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c33a0bc4e41ef169d6e807d8abb9502544b518e5;p=pandora-kernel.git perf_counter: fix race in perf_output_* When two (or more) contexts output to the same buffer, it is possible to observe half written output. Suppose we have CPU0 doing perf_counter_mmap(), CPU1 doing perf_counter_overflow(). If CPU1 does a wakeup and exposes head to user-space, then CPU2 can observe the data CPU0 is still writing. [ Impact: fix occasionally corrupted profiling records ] Signed-off-by: Peter Zijlstra Cc: Paul Mackerras Cc: Corey Ashford LKML-Reference: <20090501102533.007821627@chello.nl> Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed