]> git.hungrycats.org Git - linux/commit
[PATCH] vm: alloc_pages watermark fixes
authorNick Piggin <nickpiggin@yahoo.com.au>
Tue, 24 Aug 2004 04:25:44 +0000 (21:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 24 Aug 2004 04:25:44 +0000 (21:25 -0700)
commitac12db05e3093de2624d842dc2677621f49d0d74
treec89b351f6b2fcfec43cd68c8e0d09dc9d2a173ec
parent0d76132512fa9df6ea820fa06435eb4a80de538b
[PATCH] vm: alloc_pages watermark fixes

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: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/page_alloc.c