All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seth Jennings <sjenning@linux.vnet.ibm.com>
To: Dan Carpenter <error27@gmail.com>
Cc: gregkh@suse.de, devel@driverdev.osuosl.org,
	dan.magenheimer@oracle.com, ascardo@holoscopio.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: zcache: fix possible sleep under lock
Date: Mon, 22 Aug 2011 14:20:42 -0500	[thread overview]
Message-ID: <4E52AC0A.5090608@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110822190936.GA12248@shale.localdomain>

On 08/22/2011 02:09 PM, Dan Carpenter wrote:
> 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
> 
I guess I was looking to change it as little as possible and didn't 
know what allocations should be allowed to use the "emergency pool" of
pages.

I'll update and resend.

Thanks
--
Seth

  reply	other threads:[~2011-08-22 19:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 18:47 [PATCH] staging: zcache: fix possible sleep under lock Seth Jennings
2011-08-22 19:09 ` Dan Carpenter
2011-08-22 19:20   ` Seth Jennings [this message]
2011-08-22 19:49   ` Seth Jennings
2011-08-22 21:10     ` Dan Carpenter
2011-08-22 21:35       ` Seth Jennings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E52AC0A.5090608@linux.vnet.ibm.com \
    --to=sjenning@linux.vnet.ibm.com \
    --cc=ascardo@holoscopio.com \
    --cc=dan.magenheimer@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=error27@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.