aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 04:43:02 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:17 -0500
commitd23ad42324cc4378132e51f2fc5c9ba6cbe75182 (patch)
tree6844416befb3988e432e8f422f3a369e2f760d39 /kernel/power
parentc878538598d1e7ab41ecc0de8894e34e2fdef630 (diff)
[PATCH] Use ZVC for free_pages
This is again simplifies some of the VM counter calculations through the use of the ZVC consolidated counters. [michal.k.k.piotrowski@gmail.com: build fix] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Michal Piotrowski <michal.k.k.piotrowski@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/snapshot.c4
-rw-r--r--kernel/power/swsusp.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index c024606221c4..fc53ad068128 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -591,7 +591,7 @@ static unsigned int count_free_highmem_pages(void)
591 591
592 for_each_zone(zone) 592 for_each_zone(zone)
593 if (populated_zone(zone) && is_highmem(zone)) 593 if (populated_zone(zone) && is_highmem(zone))
594 cnt += zone->free_pages; 594 cnt += zone_page_state(zone, NR_FREE_PAGES);
595 595
596 return cnt; 596 return cnt;
597} 597}
@@ -869,7 +869,7 @@ static int enough_free_mem(unsigned int nr_pages, unsigned int nr_highmem)
869 for_each_zone(zone) { 869 for_each_zone(zone) {
870 meta += snapshot_additional_pages(zone); 870 meta += snapshot_additional_pages(zone);
871 if (!is_highmem(zone)) 871 if (!is_highmem(zone))
872 free += zone->free_pages; 872 free += zone_page_state(zone, NR_FREE_PAGES);
873 } 873 }
874 874
875 nr_pages += count_pages_for_highmem(nr_highmem); 875 nr_pages += count_pages_for_highmem(nr_highmem);
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 31aa0390c777..7fb834397a0d 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -230,9 +230,10 @@ int swsusp_shrink_memory(void)
230 for_each_zone (zone) 230 for_each_zone (zone)
231 if (populated_zone(zone)) { 231 if (populated_zone(zone)) {
232 if (is_highmem(zone)) { 232 if (is_highmem(zone)) {
233 highmem_size -= zone->free_pages; 233 highmem_size -=
234 zone_page_state(zone, NR_FREE_PAGES);
234 } else { 235 } else {
235 tmp -= zone->free_pages; 236 tmp -= zone_page_state(zone, NR_FREE_PAGES);
236 tmp += zone->lowmem_reserve[ZONE_NORMAL]; 237 tmp += zone->lowmem_reserve[ZONE_NORMAL];
237 tmp += snapshot_additional_pages(zone); 238 tmp += snapshot_additional_pages(zone);
238 } 239 }