4. what is the difference between shrink_cache() and shrink_caches(). note the 's'
Use ctags or cscope, and learn C ;)
Honestly, by now you should have seen that shrink_caches() calls shrink_zone(), which calls shrink_cache() ...
Sorry... that was a dumb question. My apologies.
I've almost gotten this figured out... except:
1. Are the active and inactive lists per zone?
From what i'm reading, it seems to be so... with struct zone having active_list and inactive_list and add_to_active_list() et al.adding to zone->active_list. Im pretty sure about this fact, but i'm not sure i understand it (the rationale behind splitting the global active/inactive lists per zone)
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?
Thanks in advance
Rahul
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/