lkml.org 
[lkml]   [2009]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [git pull] scheduler fixes
From
Date
On Sat, 2009-01-31 at 18:11 +0100, Peter Zijlstra wrote:
> > diff --git a/kernel/sched.c b/kernel/sched.c
> > index 52bbf1c..5686bb5 100644
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -4440,7 +4450,7 @@ void __kprobes sub_preempt_count(int val)
> > /*
> > * Underflow?
> > */
> > - if (DEBUG_LOCKS_WARN_ON(val > preempt_count()))
> > + if (DEBUG_LOCKS_WARN_ON(val > preempt_count() - (!!kernel_locked())))
> > return;
> > /*
> > * Is the spinlock portion underflowing?

Since the commit msg of 01e3eb8 says:

kernel_locked() is not a valid test in IRQ context (we update the
BKL's ->lock_depth and the preempt count separately and non-atomicalyy),
so we cannot put it into the generic preempt debugging checks which
can run in IRQ contexts too.

Another possibility would be writing it like:

if (DEBUG_LOCKS_WARN_ON(val > preempt_count() -
(in_interrupt() ? 0 : !!kernel_locked())))

Which might just work because we're in sub_preempt_count, before we
actually do the subtraction, so in_interrupt() will still be true.





\
 
 \ /
  Last update: 2009-01-31 18:27    [W:0.044 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site