aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gfp.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-03-05 16:42:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:26 -0500
commit452aa6999e6703ffbddd7f6ea124d3968915f3e3 (patch)
tree48e375fdb60920675f68b444b462903ad8bb6940 /include/linux/gfp.h
parentad2bd7e0e9647cd48593a6b3a2be07dc2c2d28ed (diff)
mm/pm: force GFP_NOIO during suspend/hibernation and resume
There are quite a few GFP_KERNEL memory allocations made during suspend/hibernation and resume that may cause the system to hang, because the I/O operations they depend on cannot be completed due to the underlying devices being suspended. Avoid this problem by clearing the __GFP_IO and __GFP_FS bits in gfp_allowed_mask before suspend/hibernation and restoring the original values of these bits in gfp_allowed_mask durig the subsequent resume. [akpm@linux-foundation.org: fix CONFIG_PM=n linkage] Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reported-by: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r--include/linux/gfp.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index e5567e6762f3..2e1b32c0484d 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -83,6 +83,7 @@ struct vm_area_struct;
83#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ 83#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
84 __GFP_HARDWALL | __GFP_HIGHMEM | \ 84 __GFP_HARDWALL | __GFP_HIGHMEM | \
85 __GFP_MOVABLE) 85 __GFP_MOVABLE)
86#define GFP_IOFS (__GFP_IO | __GFP_FS)
86 87
87#ifdef CONFIG_NUMA 88#ifdef CONFIG_NUMA
88#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 89#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -337,9 +338,7 @@ void drain_local_pages(void *dummy);
337 338
338extern gfp_t gfp_allowed_mask; 339extern gfp_t gfp_allowed_mask;
339 340
340static inline void set_gfp_allowed_mask(gfp_t mask) 341extern void set_gfp_allowed_mask(gfp_t mask);
341{ 342extern gfp_t clear_gfp_allowed_mask(gfp_t mask);
342 gfp_allowed_mask = mask;
343}
344 343
345#endif /* __LINUX_GFP_H */ 344#endif /* __LINUX_GFP_H */