Shrinking the List of Active Pages

Moving pages from the inactive list to the active list is one of the key actions in the implementation of the policy algorithm for page reclaim because this is where the importance of the various pages in the system (or, to be more precise, in the zone) is assessed. It therefore comes as no surprise that refill_inactive_zone is among the longer functions in the kernel. It performs the following principal steps:

1. It copies the required number of pages defined by nr_pages from the active list to a temporary, local list using isolate_lru_pages.

2. It distributes the pages over the active and inactive lists according to their activity level.

3. It frees unimportant pages in bundles.

Figure 18-15 shows the code flow diagram for the first refill_inactive_zone step.

First of all, the kernel calculates a few parameters to define the aggressiveness and the behavior of the page reclaim algorithm. Some statistical data are analyzed:

Continue reading here: Mmvmscanc

Was this article helpful?

0 0