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

From: Eric Dumazet
Date: Tue Dec 13 2005 - 12:55:36 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/