From de94a00e51ab4a0ce688aae18982f7145a562a68 Mon Sep 17 00:00:00 2001 From: Rik van Riel Date: Mon, 14 Dec 2009 17:59:48 -0800 Subject: [PATCH] --- yaml --- r: 176307 b: refs/heads/master c: b39415b2731d7dec5e612d2d12595da82399eedf h: refs/heads/master i: 176305: 91b4ecdbc4566658949796a3a6c46ec1f2ace501 176303: a01204689a04308525a814e0d8a008a1b50e3458 v: v3 --- [refs] | 2 +- trunk/mm/vmscan.c | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index f70217bfb4f9..be5864af4b3b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8aa043d74559556a661cb2eb6e64497eec86ec77 +refs/heads/master: b39415b2731d7dec5e612d2d12595da82399eedf diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 2ef59d5b16a6..04658189b9a5 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -1463,20 +1463,26 @@ static int inactive_file_is_low(struct zone *zone, struct scan_control *sc) return low; } +static int inactive_list_is_low(struct zone *zone, struct scan_control *sc, + int file) +{ + if (file) + return inactive_file_is_low(zone, sc); + else + return inactive_anon_is_low(zone, sc); +} + static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, struct zone *zone, struct scan_control *sc, int priority) { int file = is_file_lru(lru); - if (lru == LRU_ACTIVE_FILE && inactive_file_is_low(zone, sc)) { - shrink_active_list(nr_to_scan, zone, sc, priority, file); + if (is_active_lru(lru)) { + if (inactive_list_is_low(zone, sc, file)) + shrink_active_list(nr_to_scan, zone, sc, priority, file); return 0; } - if (lru == LRU_ACTIVE_ANON && inactive_anon_is_low(zone, sc)) { - shrink_active_list(nr_to_scan, zone, sc, priority, file); - return 0; - } return shrink_inactive_list(nr_to_scan, zone, sc, priority, file); }