Re: [patch 11/41] x86/irqwork: Get rid of duplicated tracing interrupt code

From: Steven Rostedt
Date: Fri Aug 25 2017 - 11:55:56 EST


On Fri, 25 Aug 2017 12:31:14 +0200
Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:


> --- a/arch/x86/kernel/irq_work.c
> +++ b/arch/x86/kernel/irq_work.c
> @@ -11,24 +11,12 @@
> #include <asm/trace/irq_vectors.h>
> #include <linux/interrupt.h>
>
> -static inline void __smp_irq_work_interrupt(void)
> -{
> - inc_irq_stat(apic_irq_work_irqs);
> - irq_work_run();
> -}
> -
> __visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs)
> {
> ipi_entering_ack_irq();
> - __smp_irq_work_interrupt();
> - exiting_irq();
> -}
> -
> -__visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs)
> -{
> - ipi_entering_ack_irq();
> + inc_irq_stat(apic_irq_work_irqs);
> trace_irq_work_entry(IRQ_WORK_VECTOR);
> - __smp_irq_work_interrupt();

This changes from what we use to have:

Original:

ipi_entering_ack_irq();
trace_irq_work_entry(IRQ_WORK_VECTOR);
inc_irq_stat(apic_irq_work_irqs);
irq_work_run();

Patched:

ipi_entering_ack_irq();
inc_irq_stat(apic_irq_work_irqs);
trace_irq_work_entry(IRQ_WORK_VECTOR);
irq_work_run();

Is there a reason for the swap? It's not mentioned in the change log.

Also, tracepoints can issue new irq works. I don't think that would be
a problem here, as interrupts are disabled in this path. Just wanted to
point it out.

-- Steve


> + irq_work_run();
> trace_irq_work_exit(IRQ_WORK_VECTOR);
> exiting_irq();
> }
>