diff options
author | Rik van Riel <riel@redhat.com> | 2011-01-13 18:47:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:46 -0500 |
commit | 9992af102974f3f8a02a1f2729c3461881539e26 (patch) | |
tree | 40958e1a8bd7efc7c9a4d28e2b77d86bb8688734 /mm | |
parent | 2c888cfbc1b45508a44763d85ba2e8ac43faff5f (diff) |
thp: scale nr_rotated to balance memory pressure
Make sure we scale up nr_rotated when we encounter a referenced
transparent huge page. This ensures pageout scanning balance is not
distorted when there are huge pages on the LRU.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.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/vmscan.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 0882014d2ce5..47a50962ce81 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -1276,7 +1276,8 @@ putback_lru_pages(struct zone *zone, struct scan_control *sc, | |||
1276 | add_page_to_lru_list(zone, page, lru); | 1276 | add_page_to_lru_list(zone, page, lru); |
1277 | if (is_active_lru(lru)) { | 1277 | if (is_active_lru(lru)) { |
1278 | int file = is_file_lru(lru); | 1278 | int file = is_file_lru(lru); |
1279 | reclaim_stat->recent_rotated[file]++; | 1279 | int numpages = hpage_nr_pages(page); |
1280 | reclaim_stat->recent_rotated[file] += numpages; | ||
1280 | } | 1281 | } |
1281 | if (!pagevec_add(&pvec, page)) { | 1282 | if (!pagevec_add(&pvec, page)) { |
1282 | spin_unlock_irq(&zone->lru_lock); | 1283 | spin_unlock_irq(&zone->lru_lock); |
@@ -1552,7 +1553,7 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone, | |||
1552 | } | 1553 | } |
1553 | 1554 | ||
1554 | if (page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) { | 1555 | if (page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) { |
1555 | nr_rotated++; | 1556 | nr_rotated += hpage_nr_pages(page); |
1556 | /* | 1557 | /* |
1557 | * Identify referenced, file-backed active pages and | 1558 | * Identify referenced, file-backed active pages and |
1558 | * give them one more trip around the active list. So | 1559 | * give them one more trip around the active list. So |