void fastcall activate_page(struct page *page) {

struct zone *zone = page_zone(page);

del_page_from_inactive_list(zone, page); SetPageActive(page); add_page_to_active_list(zone, page);

This implements exactly the transition as discussed above.

Moving a page from the active to the inactive list is hidden within a larger function that is also responsible to handle shrinking of caches in a wider context, shrink_active_list, discussed in Section 18.6.6. Internally, the function relies on page_referenced. Besides handling the PG_referenced bit in the way described above, the function is responsible to query how often the page is referenced from the page table. This is mainly an application of the reverse mapping mechanism. page_referenced requires the parameter is_locked, which declares whether the page under consideration is locked by the caller:

Continue reading here: Mmrmapc

Was this article helpful?

0 0