perf: Optimize perf_output_begin()
authorPeter Zijlstra <peterz@infradead.org>
Thu, 31 Oct 2013 16:25:38 +0000 (17:25 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 6 Nov 2013 11:34:20 +0000 (12:34 +0100)
commit85f59edf9684603026c64c902791748116d29478
tree13da84a3f347a24a3929d7546a6d7e9addbdf857
parentc72b42a3dde487132da80202756c101b371b2add
perf: Optimize perf_output_begin()

There's no point in re-doing the memory-barrier when we fail the
cmpxchg(). Also placing it after the space reservation loop makes it
clearer it only separates the userpage->tail read from the data
stores.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Michael Neuling <mikey@neuling.org>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: james.hogan@imgtec.com
Cc: Vince Weaver <vince@deater.net>
Cc: Victor Kaplansky <VICTORK@il.ibm.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Anton Blanchard <anton@samba.org>
Link: http://lkml.kernel.org/n/tip-c19u6egfldyx86tpyc3zgkw9@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/ring_buffer.c