mm, vmscan: Begin reclaiming pages on a per-node basis
Quoted 24 lines
(quoted diff) +6
-0@@ -1319,6 +1322,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, struct list_head *src = &lruvec->lists[lru]; unsigned long nr_taken = 0; unsigned long scan; + LIST_HEAD(pages_skipped); for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) { struct page *page;@@ -1329,6 +1333,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, VM_BUG_ON_PAGE(!PageLRU(page), page); + if (page_zone_id(page) > sc->reclaim_idx) + list_move(&page->lru, &pages_skipped); + switch (__isolate_lru_page(page, mode)) { case 0: nr_pages = hpage_nr_pages(page);@@ -1347,6 +1354,15 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, } } + /* + * Splice any skipped pages to the start of the LRU list. Note that
Review static unsigned long isolate_lru_pages(unsigned long nr_to_scan, · line 1368
Quoted 10 lines
(quoted diff) +7
-0+ * this disrupts the LRU order when reclaiming for lower zones but + * we cannot splice to the tail. If we did then the SWAP_CLUSTER_MAX + * scanning would soon rescan the same pages to skip and put the + * system at risk of premature OOM. + */ + if (!list_empty(&pages_skipped)) + list_splice(&pages_skipped, src); *nr_scanned = scan; trace_mm_vmscan_lru_isolate(sc->order, nr_to_scan, scan, nr_taken, mode, is_file_lru(lru));
Can we avoid splicing pages by skipping pages with scan not incremented?
Hillf
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 22 lines · Hillf Danton
Quoted 22 lines
(quoted diff) +4
-0@@ -1319,6 +1322,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, struct list_head *src = &lruvec->lists[lru]; unsigned long nr_taken = 0; unsigned long scan; + LIST_HEAD(pages_skipped); for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) { struct page *page;@@ -1329,6 +1333,9 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, VM_BUG_ON_PAGE(!PageLRU(page), page); + if (page_zone_id(page) > sc->reclaim_idx) + list_move(&page->lru, &pages_skipped); + switch (__isolate_lru_page(page, mode)) { case 0: nr_pages = hpage_nr_pages(page);@@ -1347,6 +1354,15 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, } }
Quoted 15 lines
Review static unsigned long isolate_lru_pages(unsigned long nr_to_scan, · line 1368
Quoted 12 lines
(quoted diff) +9
-0+ /* + * Splice any skipped pages to the start of the LRU list. Note that + * this disrupts the LRU order when reclaiming for lower zones but + * we cannot splice to the tail. If we did then the SWAP_CLUSTER_MAX + * scanning would soon rescan the same pages to skip and put the + * system at risk of premature OOM. + */ + if (!list_empty(&pages_skipped)) + list_splice(&pages_skipped, src); *nr_scanned = scan; trace_mm_vmscan_lru_isolate(sc->order, nr_to_scan, scan, nr_taken, mode, is_file_lru(lru));Can we avoid splicing pages by skipping pages with scan not incremented?
The reclaimers would still have to do the work of examining those pages and ignoring them even if the counters are not updated. It'll look like high CPU usage for no obvious reason.
Signature · 8 lines
Mel Gorman SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>