[Top][All Lists]

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

caching interface idea

From: Adam Olsen
Subject: caching interface idea
Date: Sat, 8 Sep 2001 14:40:54 +0000
User-agent: Mutt/1.3.20i

This has been on my mind alot lately, mostly because I've been working
on the cache system in quakeforge.  Entierly different interface of
course :)

The idea is fairly simple, and not (I don't think) dependent on
microkernel implimentations.  Basically you add an interface to the
pager that allows you to mark pages (or ranges of pages) as
"freeable".  Then the pager would be free to reclaim the pages any
time it needed more memory, and would send a notice to you when it
does so.  If you want use that memory again you have to tell the pager
to un-mark it as "freeable", which may fail incase the page is already
gone but you havn't recieved the notice yet.

A couple issues:
I *think* this would work when one app has a file mmaped, and the file
data itself is considered cache.  The host of the cache would get an
implicit notification about loosing the memory when it got a page

This would only work for fairly large-grained cache data.  It
obviously doesn't work for sizes under a pager, and the rpc cost may
be rather high unless it does a large range of pages.  Not nearly as
bad under L4 though.

A simple LRU list would probably be effective to only free the oldest

>From a programming point of view you can only use the cache for raw
data, and you have to have accounting information for the pages in
non-cache memory.  Otherwise you might have a pointer disappear out
from under you, with no way to get it back.

As an aside, Jeroen suggested I read up on how sawmill does caching.
I think I will, after I get a more thurough understanding of L4 itself

Adam Olsen, aka Rhamphoryncus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]