• Nick Piggin's avatar
    [PATCH] vm: alloc_pages watermark fixes · ac12db05
    Nick Piggin authored
    Previously the ->protection[] logic was broken.  It was difficult to follow
    and basically didn't use the asynch reclaim watermarks (pages_min,
    pages_low, pages_high) properly.
    
    Now use ->protection *only* for lower-zone protection.  So the allocator
    now explicitly uses the ->pages_low, ->pages_min watermarks and adds
    ->protection on top of that, instead of trying to use ->protection for
    everything.
    
    Pages are allocated down to (->pages_low + ->protection), once this is
    reached, kswapd the background reclaim is started; after this, we can
    allocate down to (->pages_min + ->protection) without blocking; the memory
    below pages_min is reserved for __GFP_HIGH and PF_MEMALLOC allocations. 
    kswapd attempts to reclaim memory until ->pages_high is reached.
    Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    ac12db05
page_alloc.c 50.3 KB