lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 22 Aug 2011 16:35:04 -0500
From:	Seth Jennings <sjenning@...ux.vnet.ibm.com>
To:	Dan Carpenter <error27@...il.com>
CC:	gregkh@...e.de, devel@...verdev.osuosl.org,
	dan.magenheimer@...cle.com, ascardo@...oscopio.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: zcache: fix possible sleep under lock

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ