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 16:35:04 -0500 [thread overview]
Message-ID: <4E52CB88.1060401@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110822211035.GB12248@shale.localdomain>
On 08/22/2011 04:10 PM, Dan Carpenter wrote:
> On Mon, Aug 22, 2011 at 02:49:45PM -0500, Seth Jennings wrote:
>> Actually, should this be GFP_ATOMIC or GFP_NOWAIT?
>>
>
> GFP_ATOMIC is sort of a good default answer.
>
> GFP_NOWAIT is normally used when you want to do something really
> fast and if the allocation fails, you don't want to wait for it.
> So if memory is short, and you drop a packet? Who cares! TCP has
> error handling built in. Other than that, GFP_NOWAIT is used a lot
> in the core kernel.
>
> You could be right that GFP_NOWAIT is fine here. I don't know zcache
> well enough to say. How bad is it if the allocation fails?
>
> regards,
> dan carpenter
Meh... I think GFP_ATOMIC is fine. If the allocation fails, then zcache
fails to initialise and the page cache and swaps just go down their normal
non-zache/frontswap/cleancache paths. The only time there is a difference
between GFP_ATOMIC and GFP_NOWAIT, AFAIK, is if there are no non-emergency pages
left, which is unlikely to be the case.
Plus, I don't want to have to send out v3 of a one line patch :-/
Thanks,
Seth
prev parent reply other threads:[~2011-08-22 21:35 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
2011-08-22 19:49 ` Seth Jennings
2011-08-22 21:10 ` Dan Carpenter
2011-08-22 21:35 ` Seth Jennings [this message]
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=4E52CB88.1060401@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox