aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap.h
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2010-09-09 19:38:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-09 21:57:25 -0400
commit910321ea817a202ff70fac666e37e2c8e2f88823 (patch)
treeaaead29e7797986e2b804746b565bb5d05117c54 /include/linux/swap.h
parentac8456d6f9a3011c824176bd6084d39e5f70a382 (diff)
swap: revert special hibernation allocation
Please revert 2.6.36-rc commit d2997b1042ec150616c1963b5e5e919ffd0b0ebf "hibernation: freeze swap at hibernation". It complicated matters by adding a second swap allocation path, just for hibernation; without in any way fixing the issue that it was intended to address - page reclaim after fixing the hibernation image might free swap from a page already imaged as swapcache, letting its swap be reallocated to store a different page of the image: resulting in data corruption if the imaged page were freed as clean then swapped back in. Pages freed to si->swap_map were still in danger of being reallocated by the alternative allocation path. I guess it inadvertently fixed slow SSD swap allocation for hibernation, as reported by Nigel Cunningham: by missing out the discards that occur on the usual swap allocation path; but that was unintentional, and needs a separate fix. Signed-off-by: Hugh Dickins <hughd@google.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Ondrej Zary <linux@rainbow-software.org> Cc: Andrea Gelmini <andrea.gelmini@gmail.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Nigel Cunningham <nigel@tuxonice.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/swap.h')
-rw-r--r--include/linux/swap.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 2fee51a11b73..bf4eb62506db 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -315,6 +315,7 @@ extern long nr_swap_pages;
315extern long total_swap_pages; 315extern long total_swap_pages;
316extern void si_swapinfo(struct sysinfo *); 316extern void si_swapinfo(struct sysinfo *);
317extern swp_entry_t get_swap_page(void); 317extern swp_entry_t get_swap_page(void);
318extern swp_entry_t get_swap_page_of_type(int);
318extern int valid_swaphandles(swp_entry_t, unsigned long *); 319extern int valid_swaphandles(swp_entry_t, unsigned long *);
319extern int add_swap_count_continuation(swp_entry_t, gfp_t); 320extern int add_swap_count_continuation(swp_entry_t, gfp_t);
320extern void swap_shmem_alloc(swp_entry_t); 321extern void swap_shmem_alloc(swp_entry_t);
@@ -331,13 +332,6 @@ extern int reuse_swap_page(struct page *);
331extern int try_to_free_swap(struct page *); 332extern int try_to_free_swap(struct page *);
332struct backing_dev_info; 333struct backing_dev_info;
333 334
334#ifdef CONFIG_HIBERNATION
335void hibernation_freeze_swap(void);
336void hibernation_thaw_swap(void);
337swp_entry_t get_swap_for_hibernation(int type);
338void swap_free_for_hibernation(swp_entry_t val);
339#endif
340
341/* linux/mm/thrash.c */ 335/* linux/mm/thrash.c */
342extern struct mm_struct *swap_token_mm; 336extern struct mm_struct *swap_token_mm;
343extern void grab_swap_token(struct mm_struct *); 337extern void grab_swap_token(struct mm_struct *);