Re: LBAcache devel BUGFIX and improved release

Paul Case <[email protected]> Mon, 11 Nov 2002 20:58:22 +0100
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Eric Auer wrote:

>- I remember that "use least used if have to discard one" is no good:
>  When the cache is full, the newest sectors will always be discarded too
>  soon, as they have no time to "earn importance" before new request for
>  new cache slots come in. So yes, a queue would be an idea, but this is
>  not optimal either: How to find the priority?
>  Possible solutions: Have a minimum age per slot, younger slots may not
>  be discarded. Hard to measure the age here.
>  Do indeed a queue, by allocating the buffers in a circular way, possibly
>  skipping over "too important" entries (but in the course eating up their
>  importance value, so that they will not settle at "max importance" and
>  block the cache for more useful sectors).
>
Well, you could simply hook the timer interrupt, and implement an LRU 
(least-recently-used) algorithm (have a 1 or 2 byte "age" field along 
with every entry, that would get incremented at every timer tick, and 
reset every time the entry is used).

>Bonus ideas:
>- How about a "freeze" option: Would mark all currently stored entries as
>  undiscardable. Could for example be triggered after a locate /d+ /s which
>  will read all directory sectors once.
>
Sounds like a good idea to me.

Paul Case