diff options
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index ff3a6182f5f0..47ca5a2b653b 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/cpu.h> | 20 | #include <linux/cpu.h> |
21 | #include <linux/resume-trace.h> | 21 | #include <linux/resume-trace.h> |
22 | #include <linux/freezer.h> | 22 | #include <linux/freezer.h> |
23 | #include <linux/vmstat.h> | ||
23 | 24 | ||
24 | #include "power.h" | 25 | #include "power.h" |
25 | 26 | ||
@@ -72,7 +73,8 @@ static int suspend_prepare(suspend_state_t state) | |||
72 | goto Thaw; | 73 | goto Thaw; |
73 | } | 74 | } |
74 | 75 | ||
75 | if ((free_pages = nr_free_pages()) < FREE_PAGE_NUMBER) { | 76 | if ((free_pages = global_page_state(NR_FREE_PAGES)) |
77 | < FREE_PAGE_NUMBER) { | ||
76 | pr_debug("PM: free some memory\n"); | 78 | pr_debug("PM: free some memory\n"); |
77 | shrink_all_memory(FREE_PAGE_NUMBER - free_pages); | 79 | shrink_all_memory(FREE_PAGE_NUMBER - free_pages); |
78 | if (nr_free_pages() < FREE_PAGE_NUMBER) { | 80 | if (nr_free_pages() < FREE_PAGE_NUMBER) { |