Re: [PATCH] Cpuset: rcu optimization of page alloc hook

Christoph Lameter
2005-12-13T17:42:34Z

On Tue, 13 Dec 2005, Eric Dumazet wrote:

> Say you move to read mostly most of struct kmem_cache *, they are guaranteed
> to stay in 'mostly read'.

True but then this variable is not frequently read. So false sharing would
not have much of an impact.

> Mixing for example filp_cachep and dcache_lock in the same cache line is not a
> good thing. And this is what happening on typical kernel :
>
> c04f15f0 B dcache_lock
> c04f15f4 B names_cachep
> c04f15f8 B filp_cachep
> c04f15fc b rename_lock
>
> I do think we should have defined a special section for very hot (and written)
> spots. It's more easy to locate thos hot spots than 'mostly read and shared by
> all cpus without cache ping pongs' places...

In that case I would think we would want to place these very hot
spots in their own cacheline and control which variables end up in
that particular cacheline. Define a struct something {} and put all
elements that need to go into the same cacheline into that struct.
Then cacheline align the struct.