Reclaiming Inactive Pages

Up to now, the pages in a zone have been redistributed on LRU lists to find good candidates for reclaim. However, their memory space has not been released. This final step is performed by the shrink_inactive_list and shrink_page_list functions, which work hand-in-hand. shrink_inactive_lists groups pages from zone->inactive_list into chunks, which benefits swap clustering, while shrink_page_list passes the members on the resulting list downward and sends the page to the associated backing store (which means the page is synchronized, swapped out, or discarded). This apparently simple task, however, gives rise to a few problems, as you will see below.

Besides a list of pages and the usual shrink control parameter, shrink_page_list accepts another parameter that allows two modes of operations: pageout_io_async for asynchronous and pageout_io_sync for synchronous writeout. In the first case, writeout requests are handed to the block layer without further ado, while in the second case, the kernel waits for the write operations to complete after issuing a corresponding request.

Continue reading here: Shrinking the Inactive List

Was this article helpful?

0 0