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

Eric Dumazet
2005-12-13T17:56:30Z

Christoph Lameter a écrit :
> 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.
>

If this variable is not frequently used, why then define its own cache ?

Ie why not use kmalloc() and let kernel use a general cache ?

On a 32 CPUS machine, a kmem_create() costs a *lot* of ram.

This overhead is acceptable if and only if :

- A lot of objects can be allocated in some cases (and using a special cache
can save ram because of power of two general caches alignement)

- A lot of objects are created/deleted per unit of time (performance is critical)

For example pipe() could use its own cache to speedup some benchmarks, but the
general kmalloc()/kfree() was chosen instead.

Eric