lkml.org 
[lkml]   [2003]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [NFS] RE: [autofs] multiple servers per automount
On Thu, Oct 23, 2003 at 01:00:57PM -0400, Mike Waychison wrote:
> >Would a GFP_ATOMIC make a difference to the analysis?

> Yes, sleeping within a spinlock is bad practice because it may
> eventually deadlock. Pretend that the lock is taken, the call to
> kmalloc is made, the mm system doesn't have any immidiately free memory
> and through some flow of execution requires that a some pseudo-block
> device backed filesystem needs to be mounted -> deadlock. I have no
> idea if this is currently a likely scenario, however not sleeping within
> a lock is 'The Right Thing' and should be avoided at all costs.

it's worse than that. It's forbidden. It's a VERY likely deadlock scenario
in the general sense, even if this particular case is not. If you need to
lock something and you need to sleep holding that lock, use a semaphore.

--
Notice that as computers are becoming easier and easier to use,
suddenly there's a big market for "Dummies" books. Cause and effect,
or merely an ironic juxtaposition of unrelated facts?

-
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 13:58    [W:0.036 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site