Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54273
b: refs/heads/master
c: 56f99bc
h: refs/heads/master
i:
  54271: 677fab2
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed May 7, 2007
1 parent dd05742 commit 53868f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b95e43763cfdfebc1318d27e55712e7b6bfe098
refs/heads/master: 56f99bcb52d64d70078b41cc176dd8b6f5763108
6 changes: 0 additions & 6 deletions trunk/include/linux/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,4 @@ struct saved_context;
void __save_processor_state(struct saved_context *ctxt);
void __restore_processor_state(struct saved_context *ctxt);

/*
* XXX: We try to keep some more pages free so that I/O operations succeed
* without paging. Might this be more?
*/
#define PAGES_FOR_IO 1024

#endif /* _LINUX_SWSUSP_H */
12 changes: 11 additions & 1 deletion trunk/kernel/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ struct swsusp_info {


#ifdef CONFIG_SOFTWARE_SUSPEND
extern int pm_suspend_disk(void);
/*
* Keep some memory free so that I/O operations can succeed without paging
* [Might this be more than 4 MB?]
*/
#define PAGES_FOR_IO ((4096 * 1024) >> PAGE_SHIFT)
/*
* Keep 1 MB of memory free so that device drivers can allocate some pages in
* their .suspend() routines without breaking the suspend to disk.
*/
#define SPARE_PAGES ((1024 * 1024) >> PAGE_SHIFT)

extern int pm_suspend_disk(void);
#else
static inline int pm_suspend_disk(void)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/power/swsusp.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int swsusp_shrink_memory(void)
long size, highmem_size;

highmem_size = count_highmem_pages();
size = count_data_pages() + PAGES_FOR_IO;
size = count_data_pages() + PAGES_FOR_IO + SPARE_PAGES;
tmp = size;
size += highmem_size;
for_each_zone (zone)
Expand Down

0 comments on commit 53868f8

Please sign in to comment.