[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140311121456.GA32527@localhost>
Date: Tue, 11 Mar 2014 20:14:56 +0800
From: Fengguang Wu <fengguang.wu@...el.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [reboot] WARNING: CPU: 0 PID: 112 at kernel/events/core.c:5655
perf_swevent_add()
Jiri,
It works, thank you!
Tested-by: Fengguang Wu <fengguang.wu@...el.com>
> ---
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 661951a..a53857e 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -5423,6 +5423,8 @@ struct swevent_htable {
>
> /* Recursion avoidance in each contexts */
> int recursion[PERF_NR_CONTEXTS];
> +
> + bool offline;
> };
>
> static DEFINE_PER_CPU(struct swevent_htable, swevent_htable);
> @@ -5669,8 +5671,10 @@ static int perf_swevent_add(struct perf_event *event, int flags)
> hwc->state = !(flags & PERF_EF_START);
>
> head = find_swevent_head(swhash, event);
> - if (WARN_ON_ONCE(!head))
> + if (!head) {
> + WARN_ON_ONCE(!swhash->offline);
> return -EINVAL;
> + }
>
> hlist_add_head_rcu(&event->hlist_entry, head);
>
> @@ -7850,6 +7854,7 @@ static void perf_event_init_cpu(int cpu)
> struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
>
> mutex_lock(&swhash->hlist_mutex);
> + swhash->offline = false;
> if (swhash->hlist_refcount > 0) {
> struct swevent_hlist *hlist;
>
> @@ -7907,6 +7912,7 @@ static void perf_event_exit_cpu(int cpu)
> perf_event_exit_cpu_context(cpu);
>
> mutex_lock(&swhash->hlist_mutex);
> + swhash->offline = true;
> swevent_hlist_release(swhash);
> mutex_unlock(&swhash->hlist_mutex);
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists