aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2008-12-02 13:31:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-02 18:50:40 -0500
commit9ff473b9a72942c5ac0ad35607cae28d8d59ed7a (patch)
tree32a6eca5447abc95cf7fa8482d1e3f8237806621 /mm
parentf1d0b063d993527754f062c589b73f125024d216 (diff)
vmscan: evict streaming IO first
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 <riel@redhat.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Tested-by: Gene Heskett <gene.heskett@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/swap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/swap.c b/mm/swap.c
index 2152e48a7b8f..2881987603eb 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -445,6 +445,7 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
445 for (i = 0; i < pagevec_count(pvec); i++) { 445 for (i = 0; i < pagevec_count(pvec); i++) {
446 struct page *page = pvec->pages[i]; 446 struct page *page = pvec->pages[i];
447 struct zone *pagezone = page_zone(page); 447 struct zone *pagezone = page_zone(page);
448 int file;
448 449
449 if (pagezone != zone) { 450 if (pagezone != zone) {
450 if (zone) 451 if (zone)
@@ -456,8 +457,12 @@ void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru)
456 VM_BUG_ON(PageUnevictable(page)); 457 VM_BUG_ON(PageUnevictable(page));
457 VM_BUG_ON(PageLRU(page)); 458 VM_BUG_ON(PageLRU(page));
458 SetPageLRU(page); 459 SetPageLRU(page);
459 if (is_active_lru(lru)) 460 file = is_file_lru(lru);
461 zone->recent_scanned[file]++;
462 if (is_active_lru(lru)) {
460 SetPageActive(page); 463 SetPageActive(page);
464 zone->recent_rotated[file]++;
465 }
461 add_page_to_lru_list(zone, page, lru); 466 add_page_to_lru_list(zone, page, lru);
462 } 467 }
463 if (zone) 468 if (zone)