From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Clark Williams <williams@redhat.com>
Subject: Re: [RFC][PATCH 0/2] preempt: Track unmatched preempt_enable() to preempt_disable()
Date: Thu, 16 Jan 2014 19:42:51 +0100 [thread overview]
Message-ID: <20140116184251.GA11314@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <20140116133906.50bcbc93@gandalf.local.home>
On Thu, Jan 16, 2014 at 01:39:06PM -0500, Steven Rostedt wrote:
> On Thu, 16 Jan 2014 18:45:36 +0100
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Thu, Jan 16, 2014 at 12:18:24PM -0500, Steven Rostedt wrote:
> >
> > Didn't see anything horrible in there, so fine with me.
> >
> > Another thing I recently ran into was:
> >
> > local_irq_disable();
> > preempt_disable();
> > local_irq_enable();
> >
> > local_irq_disable();
> > preempt_enable();
> > local_irq_enable();
> >
> > I'm not sure any of our debugging catches that, I meant to extend
> > lockdep, but maybe it could also be hooked into something else.
>
> Hmm, what's wrong with the above?
Suppose a reschedule interrupt happens in the middle; we set
NEED_RESCHED but won't act because preempt is disabled.
When we hit preempt_enable() we'll call into preempt_schedule() but fail
because preemptible() finds irqs_disabled().
And in the end we do not schedule, but have NEED_RESCHED set.
FAIL.
next prev parent reply other threads:[~2014-01-16 18:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 17:18 [RFC][PATCH 0/2] preempt: Track unmatched preempt_enable() to preempt_disable() Steven Rostedt
2014-01-16 17:18 ` [RFC][PATCH 1/2] preempt: Add CONFIG_DEBUG_PREEMPT_COUNT to consolidate ifdef logic Steven Rostedt
2014-01-16 17:18 ` [RFC][PATCH 2/2] preempt: Show preempt disable stack on schedule bugs Steven Rostedt
2014-01-16 17:42 ` [RFC][PATCH 0/2] preempt: Track unmatched preempt_enable() to preempt_disable() Steven Rostedt
2014-01-16 17:45 ` Peter Zijlstra
2014-01-16 18:39 ` Steven Rostedt
2014-01-16 18:42 ` Peter Zijlstra [this message]
2014-01-16 19:00 ` Steven Rostedt
2014-01-16 18:53 ` John Kacur
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=20140116184251.GA11314@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/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