All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: John Levon <movement@marcelothewonderpenguin.com>
Cc: linux-kernel@vger.kernel.org, akpm@digeo.com
Subject: Re: Sleeping function called from illegal context...
Date: 28 Sep 2002 14:27:44 -0400	[thread overview]
Message-ID: <1033237664.22582.167.camel@phantasy> (raw)
In-Reply-To: <20020928172449.GA54680@compsoc.man.ac.uk>

On Sat, 2002-09-28 at 13:24, John Levon wrote:

> NMI interrupt handler cannot block so it trylocks against a spinlock
> instead. Buffer processing code needs to block against concurrent NMI
> interrupts so takes the spinlock for them. All actual blocks on the
> spinlock are beneath a down() on another semaphore, so a sleep whilst
> holding the spinlock won't actually cause deadlock.

If all accesses to the spinlock are taken under a semaphore, then the
spinlock is not needed (i.e. the down'ed semaphore provides the same
protection), or am I missing something?

If this is not the case - e.g. there are other accesses to these locks -
then you cannot sleep, no?

I really can think of no case in which it is safe to sleep while holding
a spinlock or otherwise atomic.  If it is, then the atomicity is not
needed, sort of by definition.

	Robert Love


  reply	other threads:[~2002-09-28 18:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-27 23:30 Sleeping function called from illegal context Greg KH
2002-09-27 23:50 ` Andrew Morton
2002-09-28  0:43   ` (more) " Luc Van Oostenryck
2002-09-28  1:22     ` Andrew Morton
2002-09-28  0:44   ` Luc Van Oostenryck
2002-09-28  1:24     ` Andrew Morton
2002-09-28  2:15       ` Greg KH
2002-09-28  0:44   ` Luc Van Oostenryck
2002-09-28  1:27     ` Andrew Morton
2002-09-30 12:50       ` [Lksctp-developers] " Jon Grimm
2002-09-30 13:34       ` Jon Grimm
2002-09-28  2:04   ` Andre Hedrick
2002-09-28  3:06     ` Robert Love
2002-09-28  3:21       ` Andre Hedrick
2002-09-28  3:29         ` Robert Love
2002-09-28 10:06         ` Alan Cox
2002-09-28 17:06           ` Robert Love
2002-09-28  0:51 ` Robert Love
2002-09-28  2:16   ` Greg KH
2002-09-28 14:54   ` John Levon
2002-09-28 17:05     ` Andrew Morton
2002-09-28 17:24       ` John Levon
2002-09-28 18:27         ` Robert Love [this message]
2002-09-28 18:38           ` John Levon
2002-09-29  0:50           ` William Lee Irwin III

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=1033237664.22582.167.camel@phantasy \
    --to=rml@tech9.net \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=movement@marcelothewonderpenguin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.