Re: v3.0: Weird kernel log message when resuming avout NMI received

Cyrill Gorcunov
2011-08-01T11:21:18Z

On Mon, Aug 01, 2011 at 01:05:02PM +0200, Peter Zijlstra wrote:
> On Sun, 2011-07-31 at 19:32 +0400, Cyrill Gorcunov wrote:
>
> > > >> I'm seeing those kernel message when resuming:
> > > >>
> > > >> [ 524.973283] Uhhuh. NMI received for unknown reason 3d on CPU 0.
> > > >> [ 524.973288] Do you have a strange power saving mode enabled?
> > > >> [ 524.973289] Dazed and confused, but trying to continue
> > > >>
> > > >> I don't know if it's important or not because the system seems to work
> > > >> after but maybe it worths to report
>
> So I guess the problem is the NMI watchdog and suspend stuff not
> shutting things down properly..
>
> Argh, the PM notifier muck runs before the hotplug notifiers and it
> doesn't avoid hotplug races on its own.. what crap.
>
> something like the below perhaps, compile tested only.. does it work?
>

Thanks a huge, Peter! (I'm CC'ing Jiri as well, he has same issue)

...
> @@ -6809,7 +6810,7 @@ static void __cpuinit perf_event_init_cp
> struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
>
> mutex_lock(&swhash->hlist_mutex);
> - if (swhash->hlist_refcount > 0) {
> + if (swhash->hlist_refcount > 0 && !swhash->swevent_hlist) {

Should not there be rcu_dereference(swhash->swevent_hlist)?

> struct swevent_hlist *hlist;
>
> hlist = kzalloc_node(sizeof(*hlist), GFP_KERNEL, cpu_to_node(cpu));
...

Cyrill