Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-08 Thread Ingo Molnar
* Josh Poimboeuf wrote: > On Wed, Jun 08, 2016 at 09:56:12AM +0200, Ingo Molnar wrote: > > > > * Josh Poimboeuf wrote: > > > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -789,6 +789,13 @@ static void update_curr_fair(struct rq *rq) > > > update_curr(cfs_rq_of(&rq->

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-08 Thread Josh Poimboeuf
On Wed, Jun 08, 2016 at 09:56:12AM +0200, Ingo Molnar wrote: > > * Josh Poimboeuf wrote: > > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -789,6 +789,13 @@ static void update_curr_fair(struct rq *rq) > > update_curr(cfs_rq_of(&rq->curr->se)); > > } > > > > +void trace_

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-08 Thread Mel Gorman
On Tue, Jun 07, 2016 at 09:54:48PM +0200, Peter Zijlstra wrote: > On Tue, Jun 07, 2016 at 02:43:17PM -0500, Josh Poimboeuf wrote: > > 1. Instead of just warning and allowing the tracepoints to be broken, > >I'd argue that it would be better to make them work by forcing > >schedstats enabled

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-08 Thread Mel Gorman
On Tue, Jun 07, 2016 at 02:43:17PM -0500, Josh Poimboeuf wrote: > When enabling sched trace events via: > > echo 1 > /sys/kernel/debug/tracing/events/sched/enable > > I see a hang, with the following BUG in the printk buffer: > I was certain I had tested this case because I was monitoring to

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-08 Thread Ingo Molnar
* Josh Poimboeuf wrote: > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -789,6 +789,13 @@ static void update_curr_fair(struct rq *rq) > update_curr(cfs_rq_of(&rq->curr->se)); > } > > +void trace_sched_stat_register(void) > +{ > +#ifdef CONFIG_SCHEDSTATS > + force_scheds

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-07 Thread Josh Poimboeuf
On Tue, Jun 07, 2016 at 02:43:17PM -0500, Josh Poimboeuf wrote: > @@ -403,9 +402,10 @@ DECLARE_EVENT_CLASS(sched_stat_runtime, > (unsigned long long)__entry->vruntime) > ); > > -DEFINE_EVENT(sched_stat_runtime, sched_stat_runtime, > - TP_PROTO(struct task_struct *t

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-07 Thread Josh Poimboeuf
On Tue, Jun 07, 2016 at 09:54:48PM +0200, Peter Zijlstra wrote: > On Tue, Jun 07, 2016 at 02:43:17PM -0500, Josh Poimboeuf wrote: > > 1. Instead of just warning and allowing the tracepoints to be broken, > >I'd argue that it would be better to make them work by forcing > >schedstats enabled

Re: [PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-07 Thread Peter Zijlstra
On Tue, Jun 07, 2016 at 02:43:17PM -0500, Josh Poimboeuf wrote: > 1. Instead of just warning and allowing the tracepoints to be broken, >I'd argue that it would be better to make them work by forcing >schedstats enabled and printing a warning about that, which is what's Forcing them enable

[PATCH 2/2] sched/debug: fix deadlock when enabling sched events

2016-06-07 Thread Josh Poimboeuf
When enabling sched trace events via: echo 1 > /sys/kernel/debug/tracing/events/sched/enable I see a hang, with the following BUG in the printk buffer: BUG: spinlock recursion on CPU#1, swapper/1/0 lock: 0x88007d5d8c00, .magic: dead4ead, .owner: swapper/1/0, .owner_cpu: 1 CPU: 1 PI