Skip to contentSkip to conversation

perf: Optimize the perf_output() path by removing IRQ-disables

tip:perf/core tip-bot for Peter Zijlstra 1 participant 1 message May 18, 2010 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  ef60777c9abd999db5eb4e338aae3eb593ae8e10
Gitweb:     http://git.kernel.org/tip/ef60777c9abd999db5eb4e338aae3eb593ae8e10
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 18 May 2010 10:50:41 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 18 May 2010 18:35:48 +0200

perf: Optimize the perf_output() path by removing IRQ-disables

Since we can now assume there is only a single writer to each buffer, we can remove per-cpu lock thingy and use a simply nest-count to the same effect.

This removes the need to disable IRQs.

Cc Mike Galbraith <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <new-submission>

---
 include/linux/perf_event.h |    5 +-
 kernel/perf_event.c        |   94 +++++++++++++-------------------------------
 2 files changed, 30 insertions(+), 69 deletions(-)
include/linux/perf_event.h +2 -3
index 0b521fc..f1f853a 100644
@@ -597,12 +597,12 @@ struct perf_mmap_data {
 	atomic_t			events;		/* event_id limit       */
 
 	atomic_long_t			head;		/* write position    */
-	atomic_long_t			done_head;	/* completed head    */
 
-	atomic_t			lock;		/* concurrent writes */
 	atomic_t			wakeup;		/* needs a wakeup    */
 	atomic_t			lost;		/* nr records lost   */
 
+	atomic_t			nest;		/* nested writers    */
+
 	long				watermark;	/* wakeup watermark  */
 
 	struct perf_event_mmap_page	*user_page;
@@ -807,7 +807,6 @@ struct perf_output_handle {
 	unsigned long			offset;
 	int				nmi;
 	int				sample;
-	int				locked;
 };
 
 #ifdef CONFIG_PERF_EVENTS
kernel/perf_event.c +28 -66

179 lines not on this page · raw message