Skip to content

Commit

Permalink
vmscan: evict streaming IO first
Browse files Browse the repository at this point in the history
Count the insertion of new pages in the statistics used to drive the
pageout scanning code.  This should help the kernel quickly evict
streaming file IO.

We count on the fact that new file pages start on the inactive file LRU
and new anonymous pages start on the active anon list.  This means
streaming file IO will increment the recent scanned file statistic, while
leaving the recent rotated file statistic alone, driving pageout scanning
to the file LRUs.

Pageout activity does its own list manipulation.

Signed-off-by: Rik van Riel <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Tested-by: Gene Heskett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Rik van Riel authored and torvalds committed Dec 2, 2008
1 parent f1d0b06 commit 9ff473b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
for (i = 0; i < pagevec_count(pvec); i++) {
struct page *page = pvec->pages[i];
struct zone *pagezone = page_zone(page);
int file;

if (pagezone != zone) {
if (zone)
Expand All @@ -456,8 +457,12 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
VM_BUG_ON(PageUnevictable(page));
VM_BUG_ON(PageLRU(page));
SetPageLRU(page);
if (is_active_lru(lru))
file = is_file_lru(lru);
zone->recent_scanned[file]++;
if (is_active_lru(lru)) {
SetPageActive(page);
zone->recent_rotated[file]++;
}
add_page_to_lru_list(zone, page, lru);
}
if (zone)
Expand Down

0 comments on commit 9ff473b

Please sign in to comment.