diff options
-rw-r--r-- | include/linux/suspend.h | 6 | ||||
-rw-r--r-- | kernel/power/power.h | 12 | ||||
-rw-r--r-- | kernel/power/swsusp.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 3aecc96acc76..96868be9c211 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -52,10 +52,4 @@ struct saved_context; | |||
52 | void __save_processor_state(struct saved_context *ctxt); | 52 | void __save_processor_state(struct saved_context *ctxt); |
53 | void __restore_processor_state(struct saved_context *ctxt); | 53 | void __restore_processor_state(struct saved_context *ctxt); |
54 | 54 | ||
55 | /* | ||
56 | * XXX: We try to keep some more pages free so that I/O operations succeed | ||
57 | * without paging. Might this be more? | ||
58 | */ | ||
59 | #define PAGES_FOR_IO 1024 | ||
60 | |||
61 | #endif /* _LINUX_SWSUSP_H */ | 55 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/kernel/power/power.h b/kernel/power/power.h index a3e47cbdaf31..34b43542785a 100644 --- a/kernel/power/power.h +++ b/kernel/power/power.h | |||
@@ -14,8 +14,18 @@ struct swsusp_info { | |||
14 | 14 | ||
15 | 15 | ||
16 | #ifdef CONFIG_SOFTWARE_SUSPEND | 16 | #ifdef CONFIG_SOFTWARE_SUSPEND |
17 | extern int pm_suspend_disk(void); | 17 | /* |
18 | * Keep some memory free so that I/O operations can succeed without paging | ||
19 | * [Might this be more than 4 MB?] | ||
20 | */ | ||
21 | #define PAGES_FOR_IO ((4096 * 1024) >> PAGE_SHIFT) | ||
22 | /* | ||
23 | * Keep 1 MB of memory free so that device drivers can allocate some pages in | ||
24 | * their .suspend() routines without breaking the suspend to disk. | ||
25 | */ | ||
26 | #define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT) | ||
18 | 27 | ||
28 | extern int pm_suspend_disk(void); | ||
19 | #else | 29 | #else |
20 | static inline int pm_suspend_disk(void) | 30 | static inline int pm_suspend_disk(void) |
21 | { | 31 | { |
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 1109023d8358..5da304c8f1f6 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -233,7 +233,7 @@ int swsusp_shrink_memory(void) | |||
233 | long size, highmem_size; | 233 | long size, highmem_size; |
234 | 234 | ||
235 | highmem_size = count_highmem_pages(); | 235 | highmem_size = count_highmem_pages(); |
236 | size = count_data_pages() + PAGES_FOR_IO; | 236 | size = count_data_pages() + PAGES_FOR_IO + SPARE_PAGES; |
237 | tmp = size; | 237 | tmp = size; |
238 | size += highmem_size; | 238 | size += highmem_size; |
239 | for_each_zone (zone) | 239 | for_each_zone (zone) |