aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/power.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-01-06 03:13:46 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:40 -0500
commit72a97e08394a3b2e75481ff680ec2a0591e3cba4 (patch)
treed8ba72d6e81ad31ed10876386d3d2067921979e3 /kernel/power/power.h
parent7088a5c00103ef48782d6c359cd12b13a10666e6 (diff)
[PATCH] swsusp: improve freeing of memory
This patch makes swsusp free only as much memory as needed to complete the suspend and not as much as possible.  In the most of cases this should speed up the suspend and make the system much more responsive after resume, especially if a GUI (eg. X Windows) is used. If needed, the old behavior (ie to free as much memory as possible during suspend) can be restored by unsetting FAST_FREE in power.h Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r--kernel/power/power.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 977877c6dcfc..acdc83b3d890 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -49,18 +49,26 @@ extern void thaw_processes(void);
49extern int pm_prepare_console(void); 49extern int pm_prepare_console(void);
50extern void pm_restore_console(void); 50extern void pm_restore_console(void);
51 51
52
53/* References to section boundaries */ 52/* References to section boundaries */
54extern const void __nosave_begin, __nosave_end; 53extern const void __nosave_begin, __nosave_end;
55 54
56extern unsigned int nr_copy_pages; 55extern unsigned int nr_copy_pages;
57extern suspend_pagedir_t *pagedir_nosave; 56extern struct pbe *pagedir_nosave;
58extern suspend_pagedir_t *pagedir_save; 57
58/*
59 * This compilation switch determines the way in which memory will be freed
60 * during suspend. If defined, only as much memory will be freed as needed
61 * to complete the suspend, which will make it go faster. Otherwise, the
62 * largest possible amount of memory will be freed.
63 */
64#define FAST_FREE 1
59 65
60extern asmlinkage int swsusp_arch_suspend(void); 66extern asmlinkage int swsusp_arch_suspend(void);
61extern asmlinkage int swsusp_arch_resume(void); 67extern asmlinkage int swsusp_arch_resume(void);
62 68
69extern unsigned int count_data_pages(void);
63extern void free_pagedir(struct pbe *pblist); 70extern void free_pagedir(struct pbe *pblist);
71extern void release_eaten_pages(void);
64extern struct pbe *alloc_pagedir(unsigned nr_pages, gfp_t gfp_mask, int safe_needed); 72extern struct pbe *alloc_pagedir(unsigned nr_pages, gfp_t gfp_mask, int safe_needed);
65extern void swsusp_free(void); 73extern void swsusp_free(void);
66extern int alloc_data_pages(struct pbe *pblist, gfp_t gfp_mask, int safe_needed); 74extern int alloc_data_pages(struct pbe *pblist, gfp_t gfp_mask, int safe_needed);