Re: [NFS] RE: [autofs] multiple servers per automount

From: Tim Hockin
Date: Thu Oct 23 2003 - 12:20:30 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/