|
OS Message Boards
![]() Projects & Assignments
![]() LRU algorithm and kswapd functionality
|
| next newest topic | next oldest topic |
| Author | Topic: LRU algorithm and kswapd functionality |
|
KarinaA Member |
In the assignment it says: "Kswapd will first attempt to free pages in the buffer and page caches and then proceed to examining the shared memory pages. Finally, it will consider each process." Do we implement LRU policy for the case where it considers each process only or for every possible functionality of kswapd (i.e. including buffer and page caches and shared memory pages)? Thank you, Karina IP: Logged |
|
nst8 Administrator |
The idea is to keep a list of *all* pages in the system in LRU order, and to use this as the pool of pages to select from when allocating memory to processes. kswapd may be described as using a cached-then-shared-then-by-process algorithm for choosing pages to replace -- you need to switch this algorithm *in its entirety* to least-recently-used. [This message has been edited by nst8 (edited 11-17-2000).] IP: Logged |
|
jb605 Member |
Which function actually does the swap out thing? i.e., once I decided that a page on this lru page list, how to I actually swap it out? Seems other swap functions, like swap_out_pgd, swap_out_pmd, swap_out_vm_are, swap_out_process, none of them deal with swap out a page. quote: IP: Logged |
|
nst8 Administrator |
Well...this gets at the heart of how Linux's memory management system works -- i.e., what the assignment is all about : ) kswapd is able to swap out on a page-by-page basis ... so try to figure out how it does so. One way to start would be to *trace* through all the functions that are called during a hypothetical run of kswapd. (One of the Linux Source Navigators listed on the Resources page may be helpful for this.) [This message has been edited by nst8 (edited 11-19-2000).] IP: Logged |
|
nst8 Administrator |
Please see the "*HW5 Clarifications*" thread for an update regarding which of kswapd's pages you need to implement the LRU policy for... [This message has been edited by nst8 (edited 11-21-2000).] IP: Logged |
All times are ET (US) | next newest topic | next oldest topic |
![]() |
|