Subject: Re: [PATCH] powerpc/perf_event: Fix oops due to perf_event_do_pending call

From: Michael Ellerman <[email-masked]>
Date: Wed, 14 Apr 2010 22:11:09 +1000

On Wed, 2010-04-14 at 16:46 +1000, Paul Mackerras wrote:
> Anton Blanchard found that large POWER systems would occasionally
> crash in the exception exit path when profiling with perf_events.
> The symptom was that an interrupt would occur late in the exit path
> when the MSR[RI] (recoverable interrupt) bit was clear.  Interrupts
> should be hard-disabled at this point but they were enabled.  Because
> the interrupt was not recoverable the system panicked.
> 
...
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index 1b16b9a..0441bbd 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -532,25 +532,60 @@ void __init iSeries_time_init_early(void)
>  }
>  #endif /* CONFIG_PPC_ISERIES */
>  
> -#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_PPC32)
> -DEFINE_PER_CPU(u8, perf_event_pending);
> +#ifdef CONFIG_PERF_EVENTS
>  
> -void set_perf_event_pending(void)
> +/*
> + * 64-bit uses a byte in the PACA, 32-bit uses a per-cpu variable...
> + */

Any reason not to switch to per-cpu for both, now that you don't need to
access it from asm?

cheers