The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Michal Hocko <mhocko@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: WARNING: at kernel/sched.c:4440 sub_preempt_count+0x81/0x95()
Date: Thu, 15 Jan 2009 11:00:13 +0100	[thread overview]
Message-ID: <20090115100013.GE5833@elte.hu> (raw)
In-Reply-To: <200901151754.58311.nickpiggin@yahoo.com.au>


* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> On Tuesday 13 January 2009 23:34:25 Ingo Molnar wrote:
> > * Michal Hocko <mhocko@suse.cz> wrote:
> > > Hi,
> > > I am not sure whether someone has already reported this, but
> > > I can see the following early boot WARNING with the 2.6.29-rc1 kernel in
> > > the serial console output:
> > >
> > > ------------[ cut here ]------------
> > > WARNING: at kernel/sched.c:4440 sub_preempt_count+0x81/0x95()
> >
> > That one should be fixed in tip/master and it is in the to-Linus queue of
> > fixes:
> >
> >   http://people.redhat.com/mingo/tip.git/README
> > 	
> > it's this commit:
> >
> >   01e3eb8: Revert "sched: improve preempt debugging"
> >
> > if you want to cherry-pick the fix.
> 
> OK, but I still don't think this is the actual problem, but there is 
> something amiss in the init code being exposed by it.

the warnings triggered after a softirq, and there's already preempt-leak 
checks in the softirq code - so we can exclude that.

a hardirq might have leaked a preempt count - but that would have quite 
bad effects [with quick atomic check asserts in schedule()], wouldnt it? 
So i tend to think that this is a false positive.

One problem i can think of (and which i outlined in the revert commit log) 
is that if a hardirq hits this window in lock_kernel():

void __lockfunc lock_kernel(void)
{
        int depth = current->lock_depth+1;
                                           <-------------- HERE
        if (likely(!depth))
                __lock_kernel();
        current->lock_depth = depth;
}

then we have kernel_locked() already true (it checks lock_depth), but the 
preempt count is not elevated yet via __lock_kernel(). So if we return 
from the hardirq [and run into softirqs that end with a preempt_enable() - 
a pure hardirq exit has no preempt debug check] we'll incorrectly think 
that there's a preempt leak going on.

	Ingo

  reply	other threads:[~2009-01-15 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 12:24 WARNING: at kernel/sched.c:4440 sub_preempt_count+0x81/0x95() Michal Hocko
2009-01-13 12:34 ` Ingo Molnar
2009-01-13 13:21   ` Michal Hocko
2009-01-15  6:54   ` Nick Piggin
2009-01-15 10:00     ` Ingo Molnar [this message]
2009-01-15 10:53       ` Nick Piggin
2009-01-15 11:26         ` Ingo Molnar
2009-01-15 11:44           ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090115100013.GE5833@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.cz \
    --cc=nickpiggin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox