tech-kern archive

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

Re: Vnode API change: add global vnode cache



On 07 Apr 2014, at 19:28, Chuck Silvers <chuq%chuq.com@localhost> wrote:

> On Sun, Apr 06, 2014 at 12:14:24PM +0200, J. Hannken-Illjes wrote:
>> Currently all file systems have to implement their own cache of
>> vnode / fs node pairs.  Most file systems use a copy and pasted
>> version of ufs_ihash.
>> 
>> So add a global vnode cache with lookup and remove:
> [...]
> 
> hi,
> 
> the principle of this is good, but I have a couple concerns about the details:
> 
> - why use an rb tree instead of a hash table?
>   other people are saying that the lock contention is the same,
>   but there are two differences:
>    - updating an rb tree touches a lot more memory, so the lock is held for
>      longer.
>    - different parts of a hash table can easily be protected by
>      different locks, but that doesn't work for a tree.

Did some tests, "dbench 30" with pre-loaded vnode cache of 110592 nodes.
A hash table gives ~2.7% more throughput so I switched to a hash table.
Also replaced the cv_wait/cv_broadcast with kpause as insert collisions
are very rare and moved the common vnode initialisation to vnalloc.

New diff at http://www.netbsd.org/~hannken/vnode-pass6-3.diff

Plan to commit early wednesday ...

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig 
(Germany)



Home | Main Index | Thread Index | Old Index