public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [reboot] WARNING: CPU: 0 PID: 112 at kernel/events/core.c:5655 perf_swevent_add()
Date: Sun, 30 Mar 2014 20:41:18 +0800	[thread overview]
Message-ID: <20140330124118.GA13006@localhost> (raw)
In-Reply-To: <20140311121456.GA32527@localhost>

This fix is not yet in linux-next, can anyone help merge it? Thanks!

On Tue, Mar 11, 2014 at 08:14:56PM +0800, Fengguang Wu wrote:
> Jiri,
> 
> It works, thank you!
> 
> Tested-by: Fengguang Wu <fengguang.wu@intel.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);
> >  }

  reply	other threads:[~2014-03-30 12:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08  6:51 [reboot] WARNING: CPU: 0 PID: 112 at kernel/events/core.c:5655 perf_swevent_add() Fengguang Wu
2014-03-08  6:56 ` [perf_swevent_init] BUG: unable to handle kernel paging request at b1793514 Fengguang Wu
2014-03-10 12:53 ` [reboot] WARNING: CPU: 0 PID: 112 at kernel/events/core.c:5655 perf_swevent_add() Jiri Olsa
2014-03-10 22:40   ` Jiri Olsa
2014-03-11  0:56     ` Jiri Olsa
2014-03-11 12:14       ` Fengguang Wu
2014-03-30 12:41         ` Fengguang Wu [this message]
2014-04-06 13:41           ` Jiri Olsa
2014-03-11  2:33   ` Fengguang Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140330124118.GA13006@localhost \
    --to=fengguang.wu@intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox