Refill_inactive_scan and Swap_out, turn active pages into inactive, dirty pages. The principle of selection is not recently accessed, and age is less than 0.
Page_launder, the inactive dirty page becomes inactive Clean page.
Inactive Dirty pages, have the following features:
The usage count is 1;
Page->list chain into mapping->dirty_pages/clean_pages;
Page->next_hash and Page->pprev_hash chain into the global hash table;
PAGE->LRU chain into the global inactive_dirty_list;
The page->flags corresponds to set to Pg_dirty.
Inactive Clean pages, have the following features:
The usage count is 1;
Page->list chain into mapping->dirty_pages/clean_pages (keep it as is);
Page->next_hash and Page->pprev_hash chain into the global hash table;
PAGE->LRU chain into the page->zone->inactive_clean_list;.
If a page break is interrupted and you visit this webpage again, the Lookup_swap_cache will be called, the corresponding page will be found in the global hash table, and the reference count plus 1 to 2, but not yet moved to the active queue . When do you move to the active queue ?
The answers are in, Page_launder and Reclaim_page.
Page_launder:
if (pagetestandclearreferenced (page) | | | page->age > 0 | | At this point the reference count is greater than 1 (!page->buffers && page_count (page) > 1) | | Page_ramdisk (page)) { del_page_from_inactive_dirty_list (page); Add_page_to_active_list (page); Continue
Reclaim_page:
if (pagetestandclearreferenced (page) | | | page->age > 0 | | (!page->buffers && Page_count (page) > 1)) {//At this time the reference count is greater than 1 del_page_from_inactive_clean_list (page); Add_page_to_active_list (page); Continue; }
Linux kernel source scenario analysis-memory management recovery mapping