lkml.org 
[lkml]   [2009]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] mm: Add __GFP_NO_OOM_KILL flag
On Mon, 4 May 2009, Rafael J. Wysocki wrote:

> > > Index: linux-2.6/mm/page_alloc.c
> > > ===================================================================
> > > --- linux-2.6.orig/mm/page_alloc.c
> > > +++ linux-2.6/mm/page_alloc.c
> > > @@ -1620,7 +1620,8 @@ nofail_alloc:
> > > }
> > >
> > > /* The OOM killer will not help higher order allocs so fail */
> > > - if (order > PAGE_ALLOC_COSTLY_ORDER) {
> > > + if (order > PAGE_ALLOC_COSTLY_ORDER ||
> > > + (gfp_mask & __GFP_NO_OOM_KILL)) {
> > > clear_zonelist_oom(zonelist, gfp_mask);
> > > goto nopage;
> > > }
> >
> > This is inconsistent because __GFP_NO_OOM_KILL now implies __GFP_NORETRY
> > (the "goto nopage" above), but only for allocations with __GFP_FS set and
> > __GFP_NORETRY clear.
>
> Well, what would you suggest?
>

A couple things:

- rebase this on mmotm so that it doesn't conflict with Mel Gorman's page
allocator speedup changes, and

- avoid the final call to get_page_from_freelist() for
!(gfp_mask & __GFP_NO_OOM_KILL) by adding a check for it alongside
(gfp_mask & __GFP_FS) and !(gfp_mask & __GFP_NORETRY) because it should
really only catch parallel oom killings which won't happen in your
suspend case since it uses ALLOC_WMARK_HIGH.

The latter is important to avoid unnecessary dependencies among low-level
__GFP_* flags (although all __GFP_NO_OOM_KILL allocations should really
all be passing __GFP_NORETRY too to avoid relying too heavily on direct
reclaim).


\
 
 \ /
  Last update: 2009-05-04 18:47    [W:0.236 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site