Commit 81829a96869c8bad74a582705617e75758c4152d
Committed by
Tejun Heo
1 parent
b4f501916c
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
tile: Use this_cpu_ptr() for hardware counters
Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff
arch/tile/kernel/perf_event.c
... | ... | @@ -590,7 +590,7 @@ |
590 | 590 | */ |
591 | 591 | static void tile_pmu_stop(struct perf_event *event, int flags) |
592 | 592 | { |
593 | - struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | |
593 | + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | |
594 | 594 | struct hw_perf_event *hwc = &event->hw; |
595 | 595 | int idx = hwc->idx; |
596 | 596 | |
... | ... | @@ -616,7 +616,7 @@ |
616 | 616 | */ |
617 | 617 | static void tile_pmu_start(struct perf_event *event, int flags) |
618 | 618 | { |
619 | - struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | |
619 | + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | |
620 | 620 | int idx = event->hw.idx; |
621 | 621 | |
622 | 622 | if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED))) |
... | ... | @@ -650,7 +650,7 @@ |
650 | 650 | */ |
651 | 651 | static int tile_pmu_add(struct perf_event *event, int flags) |
652 | 652 | { |
653 | - struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | |
653 | + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | |
654 | 654 | struct hw_perf_event *hwc; |
655 | 655 | unsigned long mask; |
656 | 656 | int b, max_cnt; |
... | ... | @@ -706,7 +706,7 @@ |
706 | 706 | */ |
707 | 707 | static void tile_pmu_del(struct perf_event *event, int flags) |
708 | 708 | { |
709 | - struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | |
709 | + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | |
710 | 710 | int i; |
711 | 711 | |
712 | 712 | /* |
713 | 713 | |
... | ... | @@ -880,14 +880,14 @@ |
880 | 880 | int tile_pmu_handle_irq(struct pt_regs *regs, int fault) |
881 | 881 | { |
882 | 882 | struct perf_sample_data data; |
883 | - struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | |
883 | + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events); | |
884 | 884 | struct perf_event *event; |
885 | 885 | struct hw_perf_event *hwc; |
886 | 886 | u64 val; |
887 | 887 | unsigned long status; |
888 | 888 | int bit; |
889 | 889 | |
890 | - __get_cpu_var(perf_irqs)++; | |
890 | + __this_cpu_inc(perf_irqs); | |
891 | 891 | |
892 | 892 | if (!atomic_read(&tile_active_events)) |
893 | 893 | return 0; |