DragonFly BSD
DragonFly kernel List (threaded) for 2006-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: a take at cache coherency


From: Csaba Henk <csaba.henk@xxxxxxx>
Date: 24 Jan 2006 17:12:13 GMT

On 2006-01-24, Simon 'corecode' Schubert <corecode@xxxxxxxxxxxx> wrote:
> We need to linearize the cache entries anyways now, as we can't maintain 
> a tree structure with doubly linked lists.

We don't need to linearize them. We can use the same tree layout as in
the fs hierarchy: pointers in one direction, list of neighbours in the
other direction.

If we had such a flattened version: we would either have it as a
substitute for the tree layout, or as an addendum. (I don't see which
one of these was suggested by you, so I discuss both.)

Regarding the former: I don't think it would be sufficient. While the
cache layer could get along happily with flat groups, overlays operate
with direct "x shadows y" relations, which mans we have the tree.

So, from this on I'll assume the latter: having the flat thing as an
addendum.

> - have a ncp_shadowroot
> - have a ncp_shadowlink which maintains a single linked list to all 
> other entries in the group
> - this way we don't have to run through all entries every time when 
> doing locking.  we just lock ncp->ncp_shadowroot->ncp_exlocks++.

So then, the ncp_shadow{root,link} fields would serve as some kind of
cache. With all the befenits and drawbacks of a cache: you can retrieve
some information immediately, but you have to take care about the
validity of cached information.



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