On Wed, May 20, 2015 at 03:49:22PM +0200, Peter Zijlstra wrote:
> ---
>  kernel/events/core.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 1a3bf48..a4f93fb 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -7391,13 +7391,16 @@ static int perf_try_init_event(struct pmu *pmu, 
> struct perf_event *event)
>               ctx = perf_event_ctx_lock_nested(event->group_leader,
>                                                SINGLE_DEPTH_NESTING);
>               BUG_ON(!ctx);
> +             raw_spin_lock_irq(&ctx->lock);
>       }
>  
>       event->pmu = pmu;
>       ret = pmu->event_init(event);
>  
> -     if (ctx)
> +     if (ctx) {
> +             raw_spin_unlock_irq(&ctx->lock);
>               perf_event_ctx_unlock(event->group_leader, ctx);
> +     }
>  
>       if (ret)
>               module_put(pmu->module);

Except of course that ->event_init() likes to do an allocation :/

Needs to be fixed differently.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to