aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-04-18 11:23:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-18 14:36:58 -0400
commita21e25536169432cf9174d631972bc1cd4c75062 (patch)
tree5414335eae4b34be3e0cc0374b81d8303c6a95af /mm/vmscan.c
parentaefe6475720bd5eb8aacbc881488f3aa65618562 (diff)
PM/Hibernate: Fix memory shrinking
Commit d979677c4c0 ("mm: shrink_all_memory(): use sc.nr_reclaimed") broke the memory shrinking used by hibernation, becuse it did not update shrink_all_zones() in accordance with the other changes it made. Fix this by making shrink_all_zones() update sc->nr_reclaimed instead of overwriting its value. This fixes http://bugzilla.kernel.org/show_bug.cgi?id=13058 Reported-and-tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 39fdfb14eeaa..99155b7b8123 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2088,13 +2088,13 @@ static void shrink_all_zones(unsigned long nr_pages, int prio,
2088 nr_reclaimed += shrink_list(l, nr_to_scan, zone, 2088 nr_reclaimed += shrink_list(l, nr_to_scan, zone,
2089 sc, prio); 2089 sc, prio);
2090 if (nr_reclaimed >= nr_pages) { 2090 if (nr_reclaimed >= nr_pages) {
2091 sc->nr_reclaimed = nr_reclaimed; 2091 sc->nr_reclaimed += nr_reclaimed;
2092 return; 2092 return;
2093 } 2093 }
2094 } 2094 }
2095 } 2095 }
2096 } 2096 }
2097 sc->nr_reclaimed = nr_reclaimed; 2097 sc->nr_reclaimed += nr_reclaimed;
2098} 2098}
2099 2099
2100/* 2100/*
@@ -2115,6 +2115,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
2115 .may_unmap = 0, 2115 .may_unmap = 0,
2116 .may_writepage = 1, 2116 .may_writepage = 1,
2117 .isolate_pages = isolate_pages_global, 2117 .isolate_pages = isolate_pages_global,
2118 .nr_reclaimed = 0,
2118 }; 2119 };
2119 2120
2120 current->reclaim_state = &reclaim_state; 2121 current->reclaim_state = &reclaim_state;