Re: PG_zero

Andrew Morton
2004-10-30T21:09:38Z

Andrea Arcangeli <andrea@novell.com> wrote:
>
> I think it's much better to have PG_zero in the main page allocator than
> to put the ptes in the slab. This way we can share available zero pages with
> all zero-page users and we have a central place where people can
> generate zero pages and allocate them later efficiently.

Yup.

> This gives a whole internal knowledge to the whole buddy system and
> per-cpu subsystem of zero pages.

Makes sense. I had a go at this ages ago and wasn't able to demonstrate
much benefit on a mixed workload.

I wonder if it would help if the page zeroing in the idle thread was done
with the CPU cache disabled. It should be pretty easy to test - isn't it
just a matter of setting the cache-disable bit in the kmap_atomic()
operation?

There are quite a few patches happening in this area - the
make-kswapd-aware-of-higher-order-pages patches and the no-buddy-bitmap
patches are queued in -mm. It'll take some time to work through them
all...