linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: Andre Hedrick <andre@linux-ide.org>
Cc: Andrew Morton <akpm@digeo.com>, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Sleeping function called from illegal context...
Date: 27 Sep 2002 23:29:46 -0400	[thread overview]
Message-ID: <1033183786.22582.30.camel@phantasy> (raw)
In-Reply-To: <Pine.LNX.4.10.10209272013370.13669-100000@master.linux-ide.org>

On Fri, 2002-09-27 at 23:21, Andre Hedrick wrote:

> Glad we agree on the lock issue, thanks for confirming the point!

Great!

> There is an issue of interrupt acknowledgement and when one can pre-empt.
> I would like to resolve the issue, but I need a global caller/notifier api
> from you so I can block IO in a safe spot on the 'data transfer' state
> bar.  Yeah, blah blah on underfined terms.

Well, I do not know what the problem is (or what the hell you are
talking about, to be honest).  You really should not have any problems
with preemption over regular SMP issues.  If your code has a problem
with other code running concurrently, then it should already hold a lock
and thus be non-preemptive?

Also note we do not preempt interrupt handlers (obviously).

If you have a critical section in which you do not want to be preempted,
do a:

	preempt_disable();
	/* critical section ... */
	preempt_enable();

This would have to be code that is in user-context and does not already
hold a lock.  There are very few explicit places that need this.  You
would be the first block driver, I believe.

Whatever this issue is, note it is entirely separate from the above
locking issue.  I also want to iterate that the locking problem
(rescheduling while holding a lock) is a problem on UP even.  Yes, think
about it.  Assuming the lock really needs to be held, it is protecting a
critical region.  If we reschedule, we can enter that region (or another
one of the same data protected hopefully by the same lock).  On SMP, we
would deadlock.  But on UP we will just silently corrupt the data. 
I.e., we can race on UP here.

	Robert Love


  reply	other threads:[~2002-09-28  3:24 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 [this message]
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
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=1033183786.22582.30.camel@phantasy \
    --to=rml@tech9.net \
    --cc=akpm@digeo.com \
    --cc=andre@linux-ide.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).