mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-kernel@vger.kernel.org
Cc: rml@tech9.net
Subject: Q: preemptible kernel and interrupts consistency.
Date: Fri, 12 Jul 2002 00:33:21 +0400	[thread overview]
Message-ID: <3D2DEB91.57FA34E6@tv-sign.ru> (raw)

Hello.

Documentation/preempt-locking.txt states, that
disabled interrupts prevents preemption.

Well, unless process does not touch TIF_NEED_RESCHED.
Consider:

        // preempt_count == 0
        local_irq_disable();
        set_tsk_need_resched(current);
        preempt_disable();
        preempt_enable();

We fall into the schedule() - possible preemtion,
interruppts ENABLED in any case.

Note that this may be implicit, for example:

        __cli();
        wake_up(q);
                // spin_lock_irqsave(&q->lock, flags)
                // __wake_up_common() - sets need_resched                
                // spin_unlock_irqrestore(q->lock, flags)
                //      spin_unlock()
                //              preempt_enable()
                //                      irq_handler: I WAS HERE!!!
                //                      possible preemtion
                //      local_irq_restore() - too late

Or I am just stupid?

Oleg.

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-11 20:33 Oleg Nesterov [this message]
2002-07-11 20:41 ` Robert Love
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=3D2DEB91.57FA34E6@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    /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®