mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Q: preemptible kernel and interrupts consistency.
Date: 11 Jul 2002 13:41:47 -0700	[thread overview]
Message-ID: <1026420107.1178.279.camel@sinai> (raw)
In-Reply-To: <3D2DEB91.57FA34E6@tv-sign.ru>

On Thu, 2002-07-11 at 13:33, Oleg Nesterov wrote:

> Documentation/preempt-locking.txt states, that
> disabled interrupts prevents preemption.
> 
> Well, unless process does not touch TIF_NEED_RESCHED.

Yes, you are right, if need_resched is set under you, you will preempt
off the last unlock, even if interrupts are disabled.

However, the only places that set need_resched like that are the
scheduler and they do so also under lock so we are safe.

Also, in your example, being in an interrupt handler bumps the
preempt_count so even the scenario you give will not cause a
preemption.  If we did not bump the unlock, then your example would give
a lot of "scheduling in interrupt" BUGs so we would know it ;-)

All that said, there is a bug: the send_reschedule IPI can set
need_resched on another CPU.  If the other CPU happens to have
interrupts disabled, we can in fact preempt.  I have a patch for this I
will submit shortly.

	Robert Love


  reply	other threads:[~2002-07-11 20:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-11 20:33 Oleg Nesterov
2002-07-11 20:41 ` Robert Love [this message]
2002-07-11 21:19   ` Oleg Nesterov
2002-07-11 21:28     ` Robert Love
2002-07-11 22:07       ` Oleg Nesterov

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=1026420107.1178.279.camel@sinai \
    --to=rml@tech9.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    /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

all inboxes | Powered by JetHome®