Re: [PATCH] staging: zcache: fix possible sleep under lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 22, 2011 at 01:47:49PM -0500, Seth Jennings wrote:
> zcache_new_pool() calls kmalloc() with GFP_KERNEL which has
> __GFP_WAIT set.  However, zcache_new_pool() gets called on
> a stack that holds the swap_lock spinlock, leading to a
> possible sleep-with-lock situation. The lock is obtained
> in enable_swap_info().
> 
> The patch replaces GFP_KERNEL with GFP_IOFS, which is
> GFP_KERNEL & ~__GFP_WAIT.
> 

You should use GFP_ATOMIC.  We don't want to do IO with the locks
held.  The only reason GFP_IOFS exists is so that we can turn off
io during suspend and resume.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux