Re: Page allocator: Single Zone optimizations

Christoph Lameter
2006-11-06T17:15:39Z

On Mon, 6 Nov 2006, Andi Kleen wrote:

> I know this.
>
> > And you are right: It does not matter for those that
> > have never been used.
>
> This means it is fine to replace the constructor with an function
> that runs after kmem_cache_alloc() in this case.

No its not. RCU means that there are potential accesses after a object has
been freed and even after an object has been reallocated via
kmem_cache_alloc. A function that runs after kmem_cache_alloc() may
mess up the lock state.

> What I meant: some time ago i had patches to add a __GFP_ZERO queue to the
> page allocator. The page allocator would handle all this for everybody.
> For various reasons they never got pushed.

Yup that was probably my patchset. The problem was that I could not make
the case that this was beneficial if all cache lines of a page were
touched. It was a significant performance benefit only for sparsely
accessed pages.