mm question

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

 



Hi, I am a novice working with 2.4.20. I have a couple of questions w.r.t
shrink_caches and try_to_swap_out - help is greatly appreciated.

try_to_swap_out is adding pages to the swap_cache but I don't see the code
where it is actually swapping out... is the swap out meant to be done in
the next pass in the shrink_cache function where if a page has mapping,
writepage is called ? So, anonymous pages which do not have any buffers
are swapped this way ?  At the same time, if this is a page that has
buffers, then it is done through try_to_release_page ->
try_to_free_buffers ->..  - correct ?

was wondering how the movement between the inactive and active lists is
triggered ? in the kswapd code, refill_inactive moves the non-referenced
pages to the inactive list and try_to_swap_out checks the PTE and if the
page has recently been accessed, sets the reference bit and moves it into
the active list if it not there. now, when a new page is being
created[do_page_fault],

do_page_fault
1  do_no_page
  a -> do_anonymous_page -> lru_cache_add + mark_page_accessed
       [essentially adding to the active list]
  b -> vm_ops defined => lru_cache_add
       [adding to inactive list]
2  do_swap_page
   -> lru_cache_add + mark_page_accessed
   [adding to active list]
3  do_wp_page
   ->  lru_cache_add [adding to inactive list]

Why is this difference ? - why are 1a and 2 to the active list and 1b and
3 to the inactive list ?

Also, when is an anonymous page[belonging to a heap or stack of a process]
moved into the swap xactly ? - are buffers ever created for this page ?
is it possiblt for a page to be in the active list and swap cache ?

Thanks alot!

-gokul--
 _______________________________________________________________________












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