From: Dan Carpenter <error27@gmail.com>
To: Seth Jennings <sjenning@linux.vnet.ibm.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 22:09:36 +0300 [thread overview]
Message-ID: <20110822190936.GA12248@shale.localdomain> (raw)
In-Reply-To: <1314038869-8164-1-git-send-email-sjenning@linux.vnet.ibm.com>
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
next prev parent reply other threads:[~2011-08-22 19:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 18:47 Seth Jennings
2011-08-22 19:09 ` Dan Carpenter [this message]
2011-08-22 19:20 ` Seth Jennings
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=20110822190936.GA12248@shale.localdomain \
--to=error27@gmail.com \
--cc=ascardo@holoscopio.com \
--cc=dan.magenheimer@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sjenning@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®