Sounds like I have arrived at a kernelnewbies question. On Thu, 23 Oct 2003, Tim Hockin wrote: > 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. > > I see. But, I believe that the BKL is essentially a spinlock and it's used in all sorts of places, including by me in the patch for autofs4. Do I need to review this? What's different about the BKL? -- ,-._|\ Ian Kent / \ Perth, Western Australia *_.--._/ E-mail: raven@themaw.net v Web: http://themaw.net/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/