Re: Page Replacement in 2.6.10

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

 



On Tue, 22 Feb 2005, Rahul Iyer wrote:

> Doesn't this make the page replacement policy NRU and *not* LRU?

No.  Pages that are mapped in processes follow something almost
like NRU, but unmapped (pagecache) pages are reclaimed in a way
that's closer to Daniel Phillips' "use once" strategy, which is
like 2Q without the non-resident list.

> 1. ok... so, when a page is allocated, it is placed on the incative list 
> right? So when does this page move to the active list? I know 
> mark_page_accessed() does this, but when? I see calls to this function 
> from a whole lot of Filesystem code and from zap_pte_range().

Shrink_cache(), with help from shrink_list(), also moves some
pages from the inactive list to the active list.

> 2. Alternatively, when does the page return to the inactive list? Only when
> kswapd is woken up?

A page returns to the inactive list when refill_inactive_zone()
puts it back.

> 3. what is the direct reclaim path?

That's when a process calls try_to_free_pages itself, without
going through kswapd.

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

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

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