diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2010-05-18 04:54:20 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-05-18 12:35:49 -0400 |
commit | fa5881514ef9c9bcb29319aad85cf2d8889d91f1 (patch) | |
tree | 4ca8bc35591b05adc8556358fb91498d2057c394 /include | |
parent | ef60777c9abd999db5eb4e338aae3eb593ae8e10 (diff) |
perf: Optimize the hotpath by converting the perf output buffer to local_t
Since there is now only a single writer, we can use
local_t instead and avoid all these pesky LOCK insn.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/perf_event.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f1f853a9d5eb..ce7667616fcb 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -485,6 +485,7 @@ struct perf_guest_info_callbacks { | |||
485 | #include <linux/ftrace.h> | 485 | #include <linux/ftrace.h> |
486 | #include <linux/cpu.h> | 486 | #include <linux/cpu.h> |
487 | #include <asm/atomic.h> | 487 | #include <asm/atomic.h> |
488 | #include <asm/local.h> | ||
488 | 489 | ||
489 | #define PERF_MAX_STACK_DEPTH 255 | 490 | #define PERF_MAX_STACK_DEPTH 255 |
490 | 491 | ||
@@ -588,20 +589,18 @@ struct perf_mmap_data { | |||
588 | #ifdef CONFIG_PERF_USE_VMALLOC | 589 | #ifdef CONFIG_PERF_USE_VMALLOC |
589 | struct work_struct work; | 590 | struct work_struct work; |
590 | #endif | 591 | #endif |
591 | int data_order; | 592 | int data_order; /* allocation order */ |
592 | int nr_pages; /* nr of data pages */ | 593 | int nr_pages; /* nr of data pages */ |
593 | int writable; /* are we writable */ | 594 | int writable; /* are we writable */ |
594 | int nr_locked; /* nr pages mlocked */ | 595 | int nr_locked; /* nr pages mlocked */ |
595 | 596 | ||
596 | atomic_t poll; /* POLL_ for wakeups */ | 597 | atomic_t poll; /* POLL_ for wakeups */ |
597 | atomic_t events; /* event_id limit */ | ||
598 | 598 | ||
599 | atomic_long_t head; /* write position */ | 599 | local_t head; /* write position */ |
600 | 600 | local_t nest; /* nested writers */ | |
601 | atomic_t wakeup; /* needs a wakeup */ | 601 | local_t events; /* event limit */ |
602 | atomic_t lost; /* nr records lost */ | 602 | local_t wakeup; /* needs a wakeup */ |
603 | 603 | local_t lost; /* nr records lost */ | |
604 | atomic_t nest; /* nested writers */ | ||
605 | 604 | ||
606 | long watermark; /* wakeup watermark */ | 605 | long watermark; /* wakeup watermark */ |
607 | 606 | ||