OPERATING SYSTEMS ICOMS W4118, Dept of Computer Science, Columbia University
Home | Announcements | Lectures | Homeworks | Grades | Discussion | Resources

  OS Message Boards
  Projects & Assignments
  LRU algorithm and kswapd functionality

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   LRU algorithm and kswapd functionality
KarinaA
Member
posted 11-17-2000 11:07 AM     Click Here to See the Profile for KarinaA   Click Here to Email KarinaA     Edit/Delete Message   Reply w/Quote
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
posted 11-17-2000 08:38 PM     Click Here to See the Profile for nst8   Click Here to Email nst8     Edit/Delete Message   Reply w/Quote
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
posted 11-18-2000 08:55 PM     Click Here to See the Profile for jb605   Click Here to Email jb605     Edit/Delete Message   Reply w/Quote
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:
Originally posted by nst8:
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

nst8
Administrator
posted 11-18-2000 10:30 PM     Click Here to See the Profile for nst8   Click Here to Email nst8     Edit/Delete Message   Reply w/Quote
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
posted 11-21-2000 11:07 AM     Click Here to See the Profile for nst8   Click Here to Email nst8     Edit/Delete Message   Reply w/Quote
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

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Home


Ultimate Bulletin Board 5.45c