public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Muthian Sivathanu <muthian_s@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: scheduling with spinlocks held ?
Date: 01 Jul 2003 17:19:10 -0700	[thread overview]
Message-ID: <1057105149.1988.3381.camel@localhost> (raw)
In-Reply-To: <20030702001001.28996.qmail@web40607.mail.yahoo.com>

On Tue, 2003-07-01 at 17:10, Muthian Sivathanu wrote:

> Is it safe to assume that the kernel will not preempt
> a process when its holding a spinlock ?  I know most
> parts of the code make sure they dont yield the cpu
> when they are holding spinlocks, but I was just
> curious if there is any place that does that.

Correct.

> Basically, the context is, I need to change the
> scheduler a bit to implement "perfect nice -19"
> semantics, i.e. give cpu to nice 19 process only if no
> other normal process is ready to run.  I am wondering
> if there is a possibility of priority inversion if the
> nice-d process happens to yield the cpu and then never
> get scheduled because a normal process is spinning on
> the lock.

You will hit priority inversion... not with spinlocks but with
semaphores (and possibly more subtle issues).

The only safe way to do this safely is to boost the task's priority out
of the "idle" class when the task is inside the kernel.

It is nontrivial to juggle user vs. kernel returns such as that. Google
for Ingo Molnar's SCHED_BATCH addition to the O(1) scheduler.

	Robert Love



  reply	other threads:[~2003-07-02  0:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02  0:10 scheduling with spinlocks held ? Muthian Sivathanu
2003-07-02  0:19 ` Robert Love [this message]
2003-07-02 17:58   ` Muthian Sivathanu
2003-07-02 18:36   ` Muthian Sivathanu
2003-07-02 18:46     ` 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=1057105149.1988.3381.camel@localhost \
    --to=rml@tech9.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muthian_s@yahoo.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