Re: 2.4.15pre6aa1 (fixes google VM problem)

Linus Torvalds (torvalds@transmeta.com)
Mon, 19 Nov 2001 12:38:25 -0800 (PST)


On Mon, 19 Nov 2001, Linus Torvalds wrote:
>
> So why not have the much simpler patch to just say:
>
> min = 0;
> for (;;) {
> zone_t *z = *(zone++);
> ..
> min = (min >> 2) + z->pages_low;
> ..

Actually, as we already limit "pages_low" (for _all_ zones) through the
use of zone_balance_max[], I don't think we need to even age the minimum
pages.

And instead of doing "zone->free_pages - (1UL << order)" in
zone_free_pages(), we can do it much more efficiently just once for the
for-loop by initializing "min" to "(1UL << order)" instead of zero. So
we'd just make the loop be

min = (1UL << order);
for (;;) {
zone_t *z = *(zone++);
..
min += z->pages_low;
...

instead, which is even simpler (and then just compare page->free_pages
against "min" directly..

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/