On Wed, Feb 19, 2014 at 04:28:19PM +0000, Peter Zijlstra wrote: > On Tue, Feb 18, 2014 at 10:18:31AM +0000, Will Deacon wrote: > > On Mon, Feb 10, 2014 at 10:17:59PM +0000, Drew Richardson wrote: > > > While adding CPU on/offlining support during perf captures I get an > > > Oops both on ARM as well as my desktop x86_64. Below is a small > > > program that duplicates the issue. > > > > [...] > > > > FWIW I can reproduce this easily with -rc3 on my x86 laptop running > > hackbench in parallel with a tweaked version of your test (using > > _SC_NPROCESSORS_ONLN instead of _SC_NPROCESSORS_CONF and hotplugging off > > both CPU2 and CPU3). > > > > OK; found it, or at least, I stopped being able to make my box explode. > > Drew, can you try the below and confirm? Its still got all the debug goo > in too, but *shees* took me long enough.
This works great for me. No Oops or garbage data when a core is offlined. > + raw_spin_lock(&ctx->lock); > + ctx_sched_out(ctx, cpuctx, EVENT_ALL); > + > + list_for_each_entry(event, &ctx->event_list, event_entry) > + event->state = PERF_EVENT_STATE_off; > + > + raw_spin_unlock(&ctx->lock); I changed PERF_EVENT_STATE_off to PERF_EVENT_STATE_OFF. Drew -- 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/