Re: Prezeroing V2 [0/3]: Why and When it works

From: Andi Kleen
Date: Thu Dec 23 2004 - 15:28:38 EST

Christoph Lameter <clameter@xxxxxxx> writes:
> and why other approaches have not worked.
> o Instead of zero_page(p,order) extend clear_page to take second argument
> o Update all architectures to accept second argument for clear_pages

Sorry if there was a miscommunication, but ...
> 1. Aggregating zeroing operations to only apply to pages of higher order,
> which results in many pages that will later become order 0 to be
> zeroed in one go. For that purpose the existing clear_page function is
> extended and made to take an additional argument specifying the order of
> the page to be cleared.

But if you do that you should really use a separate function that
can use cache bypassing stores.

Normal clear_page cannot use that because it would be a loss
when the data is soon used.

So the two changes don't really make sense.

Also I must say I'm still suspicious regarding your heuristic
to trigger gang faulting - with bad luck it could lead to a lot
more memory usage to specific applications that do very sparse
usage of memory.

There should be at least an madvise flag to turn it off and a sysctl
and it would be better to trigger only on a longer sequence of
consecutive faulted pages.

> 2. Hardware support for offloading zeroing from the cpu. This avoids
> the invalidation of the cpu caches by extensive zeroing operations.
> The result is a significant increase of the page fault performance even for
> single threaded applications:

How about some numbers on i386?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at