Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Thu, Sep 22, 2016 at 11:39:09AM +0200, Peter Zijlstra wrote: > bit banging the serial port is absolutely awesome, the rest of printk > not so much. I also have this second patch that goes on top of this. I think I had more hacks (like using the per-cpu NMI buffers for output instead of the

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Thu, Sep 22, 2016 at 11:39:09AM +0200, Peter Zijlstra wrote: > bit banging the serial port is absolutely awesome, the rest of printk > not so much. I also have this second patch that goes on top of this. I think I had more hacks (like using the per-cpu NMI buffers for output instead of the

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Thu, Sep 22, 2016 at 10:36:37AM +0200, Jan Kara wrote: > On Thu 22-09-16 10:04:36, Peter Zijlstra wrote: > > On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > > > +static inline void assert_clock_updated(struct rq *rq) > > > > +{ > > > > +#ifdef CONFIG_SCHED_DEBUG > > > > +

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Thu, Sep 22, 2016 at 10:36:37AM +0200, Jan Kara wrote: > On Thu 22-09-16 10:04:36, Peter Zijlstra wrote: > > On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > > > +static inline void assert_clock_updated(struct rq *rq) > > > > +{ > > > > +#ifdef CONFIG_SCHED_DEBUG > > > > +

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Jan Kara
On Thu 22-09-16 10:04:36, Peter Zijlstra wrote: > On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > > +static inline void assert_clock_updated(struct rq *rq) > > > +{ > > > +#ifdef CONFIG_SCHED_DEBUG > > > + /* > > > + * The only reason for not seeing a clock update since the > > >

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Jan Kara
On Thu 22-09-16 10:04:36, Peter Zijlstra wrote: > On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > > +static inline void assert_clock_updated(struct rq *rq) > > > +{ > > > +#ifdef CONFIG_SCHED_DEBUG > > > + /* > > > + * The only reason for not seeing a clock update since the > > >

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > +static inline void assert_clock_updated(struct rq *rq) > > +{ > > +#ifdef CONFIG_SCHED_DEBUG > > + /* > > +* The only reason for not seeing a clock update since the > > +* last rq_pin_lock() is if we're currently skipping

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-22 Thread Peter Zijlstra
On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > +static inline void assert_clock_updated(struct rq *rq) > > +{ > > +#ifdef CONFIG_SCHED_DEBUG > > + /* > > +* The only reason for not seeing a clock update since the > > +* last rq_pin_lock() is if we're currently skipping

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Sergey Senozhatsky
Hello, On (09/21/16 20:08), Matt Fleming wrote: > On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > > > I am not sure how the above call chain is realistic. But adding > > WARN_ON() into the scheduler paths is risky in general. > > It's not clear to me why this should be the case. WARN_ON()

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Sergey Senozhatsky
Hello, On (09/21/16 20:08), Matt Fleming wrote: > On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > > > I am not sure how the above call chain is realistic. But adding > > WARN_ON() into the scheduler paths is risky in general. > > It's not clear to me why this should be the case. WARN_ON()

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Thomas Gleixner
On Wed, 21 Sep 2016, Matt Fleming wrote: > On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > > > I am not sure how the above call chain is realistic. But adding > > WARN_ON() into the scheduler paths is risky in general. > > It's not clear to me why this should be the case. WARN_ON() calls

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Thomas Gleixner
On Wed, 21 Sep 2016, Matt Fleming wrote: > On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > > > I am not sure how the above call chain is realistic. But adding > > WARN_ON() into the scheduler paths is risky in general. > > It's not clear to me why this should be the case. WARN_ON() calls

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Matt Fleming
On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > I am not sure how the above call chain is realistic. But adding > WARN_ON() into the scheduler paths is risky in general. It's not clear to me why this should be the case. WARN_ON() calls have existed in the scheduler paths since forever. If

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Matt Fleming
On Wed, 21 Sep, at 05:58:27PM, Petr Mladek wrote: > > I am not sure how the above call chain is realistic. But adding > WARN_ON() into the scheduler paths is risky in general. It's not clear to me why this should be the case. WARN_ON() calls have existed in the scheduler paths since forever. If

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Petr Mladek
On Wed 2016-09-21 14:38:13, Matt Fleming wrote: > There's no diagnostic checks for figuring out when we've accidentally > missed update_rq_clock() calls. Let's add some by piggybacking on the > rq_*pin_lock() wrappers. > > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index

Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Petr Mladek
On Wed 2016-09-21 14:38:13, Matt Fleming wrote: > There's no diagnostic checks for figuring out when we've accidentally > missed update_rq_clock() calls. Let's add some by piggybacking on the > rq_*pin_lock() wrappers. > > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index

[PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Matt Fleming
There's no diagnostic checks for figuring out when we've accidentally missed update_rq_clock() calls. Let's add some by piggybacking on the rq_*pin_lock() wrappers. The idea behind the diagnostic checks is that upon pining rq lock the rq clock should be updated, via update_rq_clock(), before

[PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()

2016-09-21 Thread Matt Fleming
There's no diagnostic checks for figuring out when we've accidentally missed update_rq_clock() calls. Let's add some by piggybacking on the rq_*pin_lock() wrappers. The idea behind the diagnostic checks is that upon pining rq lock the rq clock should be updated, via update_rq_clock(), before