OSDN Git Service

powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use
authorNicholas Piggin <npiggin@gmail.com>
Wed, 22 Sep 2021 14:54:50 +0000 (00:54 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 16 Dec 2021 10:31:45 +0000 (21:31 +1100)
commit0faf20a1ad1647c0fc0f5a367c71e5e84deaf899
treebdfd3c02c8df287d0fc8e472704892fef5638b7a
parent5a7745b96f43c69f9b4875bcf516a0341acbc3fb
powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use

Enabling MSR[EE] in interrupt handlers while interrupts are still soft
masked allows PMIs to profile interrupt handlers to some degree, beyond
what SIAR latching allows.

When perf is not being used, this is almost useless work. It requires an
extra mtmsrd in the irq handler, and it also opens the door to masked
interrupts hitting and requiring replay, which is more expensive than
just taking them directly. This effect can be noticable in high IRQ
workloads.

Avoid enabling MSR[EE] unless perf is currently in use. This saves about
60 cycles (or 8%) on a simple decrementer interrupt microbenchmark.
Replayed interrupts drop from 1.4% of all interrupts taken, to 0.003%.

This does prevent the soft-nmi interrupt being taken in these handlers,
but that's not too reliable anyway. The SMP watchdog will continue to be
the reliable way to catch lockups.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210922145452.352571-5-npiggin@gmail.com
arch/powerpc/include/asm/hw_irq.h
arch/powerpc/kernel/dbell.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/time.c