lkml.org 
[lkml]   [2016]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock()
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
> > > + * last rq_pin_lock() is if we're currently skipping updates.
> > > + */
> > > + WARN_ON_ONCE(rq->clock_update_flags < RQCF_ACT_SKIP);
> > > +#endif
> > > +}
> >
> > I am afraid that it might eventually create a deadlock.
> > For example, there is the following call chain:
> >
>
> Yeah, meh. There's already plenty WARNs in the sched code. The idea of
> course being that they should not trigger. If they do, something
> buggered already, so who bloody cares about a deadlock later ;-)

Yeah, the trouble is that you usually won't see the WARN message
before deadlocking. So WARN_ON in scheduler is usually equivalent to

if (condition)
while (1);

;) Not really helping debugging much...

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2016-09-23 00:01    [W:0.088 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site