Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56f99bcb52d64d70078b41cc176dd8b6f5763108
Commit:     56f99bcb52d64d70078b41cc176dd8b6f5763108
Parent:     9b95e43763cfdfebc1318d27e55712e7b6bfe098
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:50:52 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:12:59 2007 -0700

    swsusp: free more memory
    
    Move the definition of PAGES_FOR_IO to kernel/power/power.h and introduce
    SPARE_PAGES representing the number of pages that should be freed by the
    swsusp's memory shrinker in addition to PAGES_FOR_IO so that device drivers
    can allocate some memory (up to 1 MB total) in their .suspend() routines
    without causing the suspend to fail.
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Nigel Cunningham <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/suspend.h |    6 ------
 kernel/power/power.h    |   12 +++++++++++-
 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 3aecc96..96868be 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -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 */
diff --git a/kernel/power/power.h b/kernel/power/power.h
index a3e47cb..34b4354 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -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)
 {
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 1109023..5da304c 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to