Re: [PATCH] 1/4: rework alloc_pages

Rik van Riel
2004-08-06T12:01:43Z

On Fri, 6 Aug 2004, Nick Piggin wrote:

> for_each_zone(z) {
> if (z->free_pages < z->pages_low + z->protection)
> continue;
> else
> goto got_pg;
> }
>
> for_each_zone(z)
> wakeup_kswapd(z);

Note that since kswapd does NOT take z->protection into account,
you could end up doing too much asynchronous page recycling from
the highmem zone while having stale pages sitting around in the
normal zone.

As long as we have the lowmem protection switched off by default
we should be fine, though. Either that, or wakeup_kswapd should
tell kswapd what the threshold is ...

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan