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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 2 Jun 2009 01:14:40 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Nick Piggin <npiggin@...e.de>
cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>, Mel Gorman <mel@....ul.ie>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 3/3 -mmotm] oom: invoke oom killer for __GFP_NOFAIL

On Tue, 2 Jun 2009, Nick Piggin wrote:

> > I would really prefer if we do as Andrew suggests. Both will fix this
> > problem, so I don't see it as a different topic at all.
> 
> Well, his patch, as it stands, is a good one. Because we do have
> potential higher order GFP_NOFAIL.
> 

There's currently an inconsistency in the definition of __GFP_NOFAIL and 
its implementation.  The clearly defined purpose of the flag is:

 * __GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
 * cannot handle allocation failures.

Yet __GFP_NOFAIL allocations may fail if no progress is made via direct 
reclaim and order > PAGE_ALLOC_COSTLY_ORDER.  That's the behavior in the 
git HEAD and Mel's allocator rework in mmotm.

I've been addressing this implicitly by requiring __GFP_NOFAIL to always 
abide by the definition: we simply can never return NULL because the 
caller can't handle it (and, by definition, shouldn't even be responsible 
for considering it).

With my patch, we kill a memory hogging task that will free some memory so 
the allocation will succeed (or multiple tasks if insufficient contiguous 
memory is available).  Kernel allocations use __GFP_NOFAIL, so the fault 
of this memory freeing is entirely on the caller, not the page allocator.

My preference for handling this is to merge my patch (obviously :), and 
then hopefully deprecate __GFP_NOFAIL as much as possible although I don't 
suspect it could be eradicated forever.
--
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