#define ISOLATE_INACTIVE 0 /* Isolate inactive pages. */
#define ISOLATE_ACTIVE 1 /* Isolate active pages. */
#define ISOLATE_BOTH 2 /* Isolate both active and inactive pages. */
The comments say it all —_isolate_lru_pages can be instructed to take only pages in an active state, inactive state, or either of the two states. Since the pages are directly selected via their page frame number and not via an LRU list, all possibilities can arise. Note, however, that unused pages that are not part of any LRU list are not accepted — the page flag PG_lru must be set. Otherwise,_lru_isolate_page returns the error code -einval. This is handled in the default branch of case, and page selection can be aborted because the kernel cannot hope for a larger continuous interval because of the resulting hole anymore.
Continue reading here: Shrinking the List of Active Pages
Was this article helpful?