/* The target page is in the block, ignore it. */ if (unlikely(pfn == page_pfn)) continue;

/* Avoid holes within the zone. */ if (unlikely(!pfn_valid_within(pfn))) break;

cursor_page = pfn_to_page(pfn);

/* Check that we have not crossed a zone boundary. */ if (unlikely(page_zone_id(cursor_page) != zone_id)) continue;

switch (_isolate_lru_page(cursor_page, mode)) {

case 0:

list_move(&cursor_page->lru, dst);

break; default:


*scanned = scan; return nr_taken;

The kernel must ignore the target page — it is already contained in the set of selected pages. Processing must be aborted if the computed interval crosses a memory zone boundary because mixed allocations (e.g., mixing DMA memory with normal memory) are not allowed.

Notice that_isolate_lru_page has an extra parameter that allows for controlling the activity state of pages that compose the new cluster. Three choices are possible:

Continue reading here: Mmvmscanc

Was this article helpful?

0 0