diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-03-05 16:42:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-06 14:26:26 -0500 |
commit | 452aa6999e6703ffbddd7f6ea124d3968915f3e3 (patch) | |
tree | 48e375fdb60920675f68b444b462903ad8bb6940 /init/main.c | |
parent | ad2bd7e0e9647cd48593a6b3a2be07dc2c2d28ed (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 'init/main.c')
-rw-r--r-- | init/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/init/main.c b/init/main.c index 40aaa020cd68..41d0f10dbbc7 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -618,7 +618,7 @@ asmlinkage void __init start_kernel(void) | |||
618 | local_irq_enable(); | 618 | local_irq_enable(); |
619 | 619 | ||
620 | /* Interrupts are enabled now so all GFP allocations are safe. */ | 620 | /* Interrupts are enabled now so all GFP allocations are safe. */ |
621 | set_gfp_allowed_mask(__GFP_BITS_MASK); | 621 | gfp_allowed_mask = __GFP_BITS_MASK; |
622 | 622 | ||
623 | kmem_cache_init_late(); | 623 | kmem_cache_init_late(); |
624 | 624 | ||