tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kmem caches and the cache line size



On Fri, 24 Jan 2020 11:09:51 +0000
Andrew Doran <ad%netbsd.org@localhost> wrote:

> Hi,
> 
> This zero pads the cache names to be more readable in vmstat output,
> and avoids creation of caches where the item size is not a factor or
> multiple of the cache line size.
> 
> 	http://www.netbsd.org/~ad/2020/kmem.diff
> 
> This gives me a repeatable 1-2% speed up on compile jobs on my test
> system, means that __aligned(COHERENCY_UNIT) can be used more easily
> in structures allocated with kmem_alloc(), and permits removal of a
> bunch of padding and rounding done during allocation.
> 
> Comments?
> 
> Cheers,
> Andrew

Hi,

looks good to me.

Just a thought I have no numbers to back that...
It might be worse a try to drop the small 8 byte cache as that
would half the size of the kmem_cache array for lookups,
the 24, 40, 56 and 80 byte (etc) ones should be gone with your changes
anyway.
(1024 => 512 bytes with 64 bit pointers)

Assuming COHERENCY_UNIT of either 32 (mips) 64 (most) and 128 ia64.


Lars


-----
You will continue to suffer
if you have an emotional reaction to everything that is said to you.
True power is sitting back and observing everything with logic.
If words control you that means everyone else can control you.
Breathe and allow things to pass.

--- Bruce Lee



Home | Main Index | Thread Index | Old Index