Wednesday, April 29, 2009

Page Reclaim

PFRA works on
1. user mode process pages
2. kernel caches

there are two aspects of swapping: the mechanism (writeback) and the policy (page reclaim).

each zone has 2 lru lists: active and inactive. if a page is lru, PG_lru flag is set, if active then PG_active flag is also set, inactive flag is cleared. pages are linked with the lru list member. the whole lru list locked with lru_lock spinlock of that zone.

lru list contains pages from only: 1. user mode addr spc pages, 2. page cache. so, no free pages of that zone will be in lru list.

these pages are referenced by: 1. usr proc, 2. fs layer code, 3. device driver

mark_page_accessed() makes a slow move of pages between active and inactive list (using act, ref flags combination)


there is no lock on the whole memory object page tables. the lock has been taken to pmd only. so, a pmd page has a lock associated with it. (spinlock)

page private field encodes the swap entry number. (NOTE: for a buffer page, the private field stores the buffer head of the first block of data.)

No comments:

Post a Comment