Re: Reading the LRU Active and Incative List

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

 



Hi Bithika...

Replies are below... just sharing my thoughts..

> 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.

IMHO that's because in reality pages get allocated (and de-allocated) in 
non ordered fashion. Also, nothing prevents you to allocate non 
physically contigous memory pages. And that means...well, non ordered 
PFN of the pages.


>2. What is the difference between page->lru and
> zone->active_list/zone_inactive_list?

I think the name speaks for itself. "page" is the list of all pages, 
while "zone" means pages that belongs on certain zone (DMA, normal, 
highmem (doesn't exist in 64-bit machines)). Sorry, I can't give any 
ideas about your #1 question.

Somebody CMIIW.

regards,

Mulyadi.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux