public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Cusack <fcusack@fcusack.com>
To: Robert Love <rml@tech9.net>
Cc: Ingo Oeser <ioe-lkml@rameria.de>, linux-kernel@vger.kernel.org
Subject: Re: preemption when running in the kernel
Date: Sun, 9 Nov 2003 02:04:24 -0800	[thread overview]
Message-ID: <20031109020424.A801@google.com> (raw)
In-Reply-To: <1068337385.27320.203.camel@localhost>; from rml@tech9.net on Sat, Nov 08, 2003 at 07:23:05PM -0500

On Sat, Nov 08, 2003 at 07:23:05PM -0500, Robert Love wrote:
> On Sat, 2003-11-08 at 08:01, Ingo Oeser wrote:
> 
> > While having preemption disabled or while actually holding a spinlock,
> > preemption is disabled.
> > 
> > Disabling preemption is modifying a count, which must reach 0 again to
> > have preemption enabled and trigger an reschedule, if needed.
> > 
> > Think of it roughly as a "counter of reasons to not preempt". If there
> > are no reasons anymore, then we preempt.
> 
> Hi, Ingo.
> 
> This is an accurate description of 2.6, but Frank said for 2.4.
> 
> So, Frank, this is correct for 2.6 or 2.4 with the preempt-kernel patch,
> but not a stock 2.4 kernel.  A stock 2.4 kernel will never preempt a
> task running inside the kernel.

Thank you for the clarification.

That leads me to 2 followup questions.

If a task in the kernel is preempted, is a membar issued?  (I believe
so -- running another task means that the scheduler must have run,
which will grab and release various locks thus giving us the membars.)

When the preempted task resumes, is it guaranteed to run on the same CPU?
(I wouldn't expect so, unless the task was specifically told to do that
via hard affinity.  But maybe a task preempted in the kernel is different
then a task preempted in userland.)

/fc

  reply	other threads:[~2003-11-09 10:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-07 12:04 preemption when running in the kernel Frank Cusack
2003-11-08 13:01 ` Ingo Oeser
2003-11-09  0:23   ` Robert Love
2003-11-09 10:04     ` Frank Cusack [this message]
2003-11-09 17:56       ` Robert Love

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=20031109020424.A801@google.com \
    --to=fcusack@fcusack.com \
    --cc=ioe-lkml@rameria.de \
    --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