Skip to content

Commit a8b0ca1

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
perf: Remove the nmi parameter from the swevent and overflow interface
The nmi parameter indicated if we could do wakeups from the current context, if not, we would set some state and self-IPI and let the resulting interrupt do the wakeup. For the various event classes: - hardware: nmi=0; PMI is in fact an NMI or we run irq_work_run from the PMI-tail (ARM etc.) - tracepoint: nmi=0; since tracepoint could be from NMI context. - software: nmi=[0,1]; some, like the schedule thing cannot perform wakeups, and hence need 0. As one can see, there is very little nmi=1 usage, and the down-side of not using it is that on some platforms some software events can have a jiffy delay in wakeup (when arch_irq_work_raise isn't implemented). The up-side however is that we can remove the nmi parameter and save a bunch of conditionals in fast paths. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Michael Cree <mcree@orcon.net.nz> Cc: Will Deacon <will.deacon@arm.com> Cc: Deng-Cheng Zhu <dengcheng.zhu@gmail.com> Cc: Anton Blanchard <anton@samba.org> Cc: Eric B Munson <emunson@mgebm.net> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Don Zickus <dzickus@redhat.com> Link: http://lkml.kernel.org/n/tip-agjev8eu666tvknpb3iaj0fg@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 1880c4a commit a8b0ca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+119
-141
lines changed

arch/alpha/kernel/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
847847
data.period = event->hw.last_period;
848848

849849
if (alpha_perf_event_set_period(event, hwc, idx)) {
850-
if (perf_event_overflow(event, 1, &data, regs)) {
850+
if (perf_event_overflow(event, &data, regs)) {
851851
/* Interrupts coming too quickly; "throttle" the
852852
* counter, i.e., disable it for a little while.
853853
*/

arch/arm/kernel/perf_event_v6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ armv6pmu_handle_irq(int irq_num,
479479
if (!armpmu_event_set_period(event, hwc, idx))
480480
continue;
481481

482-
if (perf_event_overflow(event, 0, &data, regs))
482+
if (perf_event_overflow(event, &data, regs))
483483
armpmu->disable(hwc, idx);
484484
}
485485

arch/arm/kernel/perf_event_v7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ static irqreturn_t armv7pmu_handle_irq(int irq_num, void *dev)
787787
if (!armpmu_event_set_period(event, hwc, idx))
788788
continue;
789789

790-
if (perf_event_overflow(event, 0, &data, regs))
790+
if (perf_event_overflow(event, &data, regs))
791791
armpmu->disable(hwc, idx);
792792
}
793793

arch/arm/kernel/perf_event_xscale.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ xscale1pmu_handle_irq(int irq_num, void *dev)
251251
if (!armpmu_event_set_period(event, hwc, idx))
252252
continue;
253253

254-
if (perf_event_overflow(event, 0, &data, regs))
254+
if (perf_event_overflow(event, &data, regs))
255255
armpmu->disable(hwc, idx);
256256
}
257257

@@ -583,7 +583,7 @@ xscale2pmu_handle_irq(int irq_num, void *dev)
583583
if (!armpmu_event_set_period(event, hwc, idx))
584584
continue;
585585

586-
if (perf_event_overflow(event, 0, &data, regs))
586+
if (perf_event_overflow(event, &data, regs))
587587
armpmu->disable(hwc, idx);
588588
}
589589

arch/arm/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static long ptrace_hbp_idx_to_num(int idx)
396396
/*
397397
* Handle hitting a HW-breakpoint.
398398
*/
399-
static void ptrace_hbptriggered(struct perf_event *bp, int unused,
399+
static void ptrace_hbptriggered(struct perf_event *bp,
400400
struct perf_sample_data *data,
401401
struct pt_regs *regs)
402402
{

arch/arm/kernel/swp_emulate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static int swp_handler(struct pt_regs *regs, unsigned int instr)
183183
unsigned int address, destreg, data, type;
184184
unsigned int res = 0;
185185

186-
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, regs->ARM_pc);
186+
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, regs->ARM_pc);
187187

188188
if (current->pid != previous_pid) {
189189
pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",

arch/arm/mm/fault.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
318318
fault = __do_page_fault(mm, addr, fsr, tsk);
319319
up_read(&mm->mmap_sem);
320320

321-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, addr);
321+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
322322
if (fault & VM_FAULT_MAJOR)
323-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, 0, regs, addr);
323+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, addr);
324324
else if (fault & VM_FAULT_MINOR)
325-
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, 0, regs, addr);
325+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, addr);
326326

327327
/*
328328
* Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR

arch/mips/kernel/perf_event.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ handle_associated_event(struct cpu_hw_events *cpuc,
527527
if (!mipspmu_event_set_period(event, hwc, idx))
528528
return;
529529

530-
if (perf_event_overflow(event, 0, data, regs))
530+
if (perf_event_overflow(event, data, regs))
531531
mipspmu->disable_event(idx);
532532
}
533533

arch/mips/kernel/traps.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,12 +578,12 @@ static int simulate_llsc(struct pt_regs *regs, unsigned int opcode)
578578
{
579579
if ((opcode & OPCODE) == LL) {
580580
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,
581-
1, 0, regs, 0);
581+
1, regs, 0);
582582
return simulate_ll(regs, opcode);
583583
}
584584
if ((opcode & OPCODE) == SC) {
585585
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,
586-
1, 0, regs, 0);
586+
1, regs, 0);
587587
return simulate_sc(regs, opcode);
588588
}
589589

@@ -602,7 +602,7 @@ static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode)
602602
int rd = (opcode & RD) >> 11;
603603
int rt = (opcode & RT) >> 16;
604604
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,
605-
1, 0, regs, 0);
605+
1, regs, 0);
606606
switch (rd) {
607607
case 0: /* CPU number */
608608
regs->regs[rt] = smp_processor_id();
@@ -640,7 +640,7 @@ static int simulate_sync(struct pt_regs *regs, unsigned int opcode)
640640
{
641641
if ((opcode & OPCODE) == SPEC0 && (opcode & FUNC) == SYNC) {
642642
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,
643-
1, 0, regs, 0);
643+
1, regs, 0);
644644
return 0;
645645
}
646646

arch/mips/kernel/unaligned.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
111111
unsigned long value;
112112
unsigned int res;
113113

114-
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS,
115-
1, 0, regs, 0);
114+
perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
116115

117116
/*
118117
* This load never faults.
@@ -517,7 +516,7 @@ asmlinkage void do_ade(struct pt_regs *regs)
517516
mm_segment_t seg;
518517

519518
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS,
520-
1, 0, regs, regs->cp0_badvaddr);
519+
1, regs, regs->cp0_badvaddr);
521520
/*
522521
* Did we catch a fault trying to load an instruction?
523522
* Or are we running in MIPS16 mode?

0 commit comments

Comments
 (0)