I think i worded it wrong... There is only 1 page cache. It's structure and replacement policy could be chosen at boot time. For example, you could select kernel boot time argument, say page_cache, as page_cache=LRU and the page cache would follow an LRU based replacement scheme. Or maybe page_cache=CART and you'd have CART instead.2. The current design allows kind of restricts to page cache to it's current active/inactive list form. Wouldn't it be better to generalize this? For example, something like
struct page_cache { struct list_head[MAX_LISTS]; void (*add_to_cache)(struct page *p); void (*del_from_cache)(struct page *); void (*page_accessed)(struct page *); };
In this way, one could have multiple page caches as desired, and could select
at complie time or maybe eve boot time (via a kernel arg). Now, writing a new
page replacement policy is as simple as implementing the above struct. Does
this make any sense? Or am i missing the big picture?
How would you decide from which page cache to free pages ?
Hope i got the explanation right this time around.
ciao
rahul
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/