aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2009-01-07 21:08:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:07 -0500
commitf89eb90e33fd4e4e0cc1a6d20afd63c5a561885a (patch)
tree2e39e02196dda539c900383ab03f08a311124cd9 /mm
parent670ec2f170301425fc4fdfa63d40652071fe85f6 (diff)
inactive_anon_is_low: move to vmscan
The inactive_anon_is_low() is called only vmscan. Then it can move to vmscan.c This patch doesn't have any functional change. Reviewd-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> Cc: Hugh Dickins <hugh@veritas.com> Cc: KOSAKI Motohiro <kosaki.motohiro@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')
-rw-r--r--mm/vmscan.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 45983af1de3d..f75d924cb4f4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1291,6 +1291,26 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
1291 pagevec_release(&pvec); 1291 pagevec_release(&pvec);
1292} 1292}
1293 1293
1294/**
1295 * inactive_anon_is_low - check if anonymous pages need to be deactivated
1296 * @zone: zone to check
1297 *
1298 * Returns true if the zone does not have enough inactive anon pages,
1299 * meaning some active anon pages need to be deactivated.
1300 */
1301static int inactive_anon_is_low(struct zone *zone)
1302{
1303 unsigned long active, inactive;
1304
1305 active = zone_page_state(zone, NR_ACTIVE_ANON);
1306 inactive = zone_page_state(zone, NR_INACTIVE_ANON);
1307
1308 if (inactive * zone->inactive_ratio < active)
1309 return 1;
1310
1311 return 0;
1312}
1313
1294static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, 1314static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
1295 struct zone *zone, struct scan_control *sc, int priority) 1315 struct zone *zone, struct scan_control *sc, int priority)
1296{ 1316{