diff options
author | Rik van Riel <riel@redhat.com> | 2008-10-18 23:26:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:50:25 -0400 |
commit | 556adecba110bf5f1db6c6b56416cfab5bcab698 (patch) | |
tree | a721d84d28c4d99a54632b472b452ea3d4b2b137 /mm/vmstat.c | |
parent | 4f98a2fee8acdb4ac84545df98cccecfd130f8db (diff) |
vmscan: second chance replacement for anonymous pages
We avoid evicting and scanning anonymous pages for the most part, but
under some workloads we can end up with most of memory filled with
anonymous pages. At that point, we suddenly need to clear the referenced
bits on all of memory, which can take ages on very large memory systems.
We can reduce the maximum number of pages that need to be scanned by not
taking the referenced state into account when deactivating an anonymous
page. After all, every anonymous page starts out referenced, so why
check?
If an anonymous page gets referenced again before it reaches the end of
the inactive list, we move it back to the active list.
To keep the maximum amount of necessary work reasonable, we scale the
active to inactive ratio with the size of memory, using the formula
active:inactive ratio = sqrt(memory in GB * 10).
Kswapd CPU use now seems to scale by the amount of pageout bandwidth,
instead of by the amount of memory present in the system.
[kamezawa.hiroyu@jp.fujitsu.com: fix OOM with memcg]
[kamezawa.hiroyu@jp.fujitsu.com: memcg: lru scan fix]
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r-- | mm/vmstat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index 27400b7da7c4..4380b0dba6d9 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -738,10 +738,12 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat, | |||
738 | seq_printf(m, | 738 | seq_printf(m, |
739 | "\n all_unreclaimable: %u" | 739 | "\n all_unreclaimable: %u" |
740 | "\n prev_priority: %i" | 740 | "\n prev_priority: %i" |
741 | "\n start_pfn: %lu", | 741 | "\n start_pfn: %lu" |
742 | "\n inactive_ratio: %u", | ||
742 | zone_is_all_unreclaimable(zone), | 743 | zone_is_all_unreclaimable(zone), |
743 | zone->prev_priority, | 744 | zone->prev_priority, |
744 | zone->zone_start_pfn); | 745 | zone->zone_start_pfn, |
746 | zone->inactive_ratio); | ||
745 | seq_putc(m, '\n'); | 747 | seq_putc(m, '\n'); |
746 | } | 748 | } |
747 | 749 | ||