David Howells wrote:

> +     /* we allocated a power-of-2 sized page set, so we need to trim off the
> +      * excess */
> +     total = 1 << order;
> +     atomic_add(total, &mmap_pages_allocated);
> +
> +     point = len >> PAGE_SHIFT;
> +     while (point < total) {
> +             order = ilog2(total - point);
> +             _debug("shave %u/%lu", 1 << order, total - point);
> +             atomic_sub(1 << order, &mmap_pages_allocated);
> +             __free_pages(pages + point, order);
> +             point += 1 << order;
> +     }

Note that we've had a similar change in our kernel, and we've had to
revert it since the effect on fragmentation is just horrendous.  Without
this, we could run a complete gcc testsuite on the board; with it we'd
run out of high-order pages somewhere in the middle.

This probably wants to be dependent on something like MAP_TRIM_EXCESS.


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to