public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ludovic fernandez <ludovic.fernandez@sun.com>
To: george anzinger <george@mvista.com>
Cc: Roger Larsson <roger.larsson@norran.net>,
	Daniel Phillips <phillips@innominate.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.4.0-prerelease: preemptive kernel.
Date: Thu, 04 Jan 2001 22:45:51 -0800	[thread overview]
Message-ID: <3A556D9F.934AEAFD@sun.com> (raw)
In-Reply-To: <3A53D863.53203DF4@sun.com> <3A5427A6.26F25A8A@innominate.de> <3A5437A1.F540D794@sun.com> <01010423104900.01080@dox> <3A555BA3.A0B65A81@mvista.com>

george anzinger wrote:

> Roger Larsson wrote:
> >
>
> > This part can probably be put in a proper non inline function.
> > Cache issues...
> > +                /*
> > +                * At that point a scheduling is healthy iff:
> > +                * - a scheduling request is pending.
> > +                * - the task is in running state.
> > +                * - this is not an interrupt context.
> > +                * - local interrupts are enabled.
> > +                */
> > +                if (current->need_resched == 1     &&
> > +                   current->state == TASK_RUNNING &&
> > +                   !in_interrupt()                &&
> > +                   local_irq_are_enabled())
> > +                {
> > +                        schedule();
> > +                }
> >
> Actually the MontaVista Patch cleverly removes the tests for
> in_interrupt() and local_irq_are_enabled() AND the state ==
> TASK_RUNNING.  In actual fact these states can be considered way points
> on the system status vector.  For example the interrupts off state
> implies all the rest, the in_interrupt() implies not preemptable and
> finally, not preemptable is one station away from fully preemptable.
>
> TASK_RUNNING is easily solved by makeing schedule() aware that it is
> being called for preemption.  See the MontaVista patch for details.
>

Humm, I'm just curious,
Regarding in_interrupt(). How do you deal with soft interrupts?
Guys calling cpu_bh_disable() or even incrementing the count on
their own. I don't know if this acceptable but definitely can be done,
I prefer to rely on fact than on API.
Regarding local_irq_enabled(). How do you handle the code that
call local_irq_disable(), then spin_lock(), spin_unlock() and only
re-enable the interruptions ? In this case, you preempt code that
is supposed to run interruptions disabled.
Finally, regarding the test on the task state, there may be a cache issue
but calling schedule() has also some overhead.

Ludo.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-05  6:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-04  1:56 [PATCH] 2.4.0-prerelease: preemptive kernel ludovic fernandez
2001-01-04  7:35 ` Daniel Phillips
2001-01-04  8:11   ` Andi Kleen
2001-01-04 12:32     ` Anton Blanchard
2001-01-04 12:44       ` Andi Kleen
2001-01-04 21:54         ` Nigel Gamble
2001-01-04 21:39     ` Nigel Gamble
2001-01-04 22:09       ` Andi Kleen
2001-01-04 22:28         ` Nigel Gamble
2001-01-04  8:43   ` ludovic fernandez
2001-01-04 22:10     ` Roger Larsson
2001-01-04 23:16       ` ludovic fernandez
2001-01-05  0:10         ` Nigel Gamble
2001-01-05  0:36           ` ludovic fernandez
2001-01-05  0:45             ` Andi Kleen
2001-01-05  1:13               ` Alan Olsen
2001-01-05  5:29       ` george anzinger
2001-01-05  6:45         ` ludovic fernandez [this message]
2001-01-05  8:10           ` george anzinger
2001-01-04 21:28   ` Nigel Gamble
2001-01-04  9:00 ` David Woodhouse
2001-01-04 16:17 ` Rik van Riel
2001-01-04 20:06 ` Nigel Gamble
2001-01-04 20:36   ` ludovic fernandez
2001-01-05  0:56     ` Daniel Phillips

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=3A556D9F.934AEAFD@sun.com \
    --to=ludovic.fernandez@sun.com \
    --cc=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phillips@innominate.de \
    --cc=roger.larsson@norran.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