I am working with linux kernel 2.6.18.
I am trying to read the LRU active list for each zone starting from the head of the active list. Following is a code snippet
**********************************************
show_active(&zone->active_list);
void show_active(struct list_head *init_active_list){
struct list_head *temp;
struct page *p;
for (temp=init_active_list->next; temp != init_active_list; temp=temp->next){
p = list_entry(temp, struct page, lru);
}
}
*********************************************
However, when I print page frame numbers obtained from above, I notice that the page frame numbers seem to move back and forth in the active list and doesnot seem to follow a stack order as maintained by the kernel when it adds new pages to the head of the active list. Here are my questions
1. Is zone->active_list the head of the active LRU list for that zone?
2. What is the difference between page->lru and zone->active_list/zone_inactive_list?
Thanks
Bithika