lkml.org 
[lkml]   [2001]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: brlock_is_locked()?
On Wed, Aug 22 2001, Brad Chapman wrote:
> > (I checked the brlock code and didn't find any schedule()s; there's
> > probably a reason for that).
> >
> > Ummm, this is SMP 101, you can't sleep with a lock held.
> > The global kernel lock is special in this regard, but all
> > other SMP locking primitives may not sleep.
>
> Grrr....I read Rusty's Unreliable Guide to Kernel Locking (twice) and
> still didn't remember that. Guess you have to schedule() yourself.

Errr, like Dave said, _you cannot sleep while holding a lock_. It's not
just that the locking primitives themselves don't sleep, you must not
call schedule() (or any other function that may block/sleep) while
holding a lock. _That's_ SMP 101 :-)

--
Jens Axboe

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

\
 
 \ /
  Last update: 2005-03-22 12:58    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site