diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2007-05-06 23:50:40 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 21:12:58 +0200 |
commit | 433ecb4ab312f873870b67ee374502e84f6dcf92 (patch) | |
tree | 6df7459af26ba1f09bfffcf7029a838037bb595a /kernel/power | |
parent | ARM26: remove useless config option GENERIC_BUST_SPINLOCK. (diff) | |
download | linux-433ecb4ab312f873870b67ee374502e84f6dcf92.tar.xz linux-433ecb4ab312f873870b67ee374502e84f6dcf92.zip |
fix refrigerator() vs thaw_process() race
refrigerator() can miss a wakeup, "wait event" loop needs a proper memory
ordering.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/process.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index 6d566bf7085c..0eb5c420e8ed 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -47,8 +47,10 @@ void refrigerator(void) recalc_sigpending(); /* We sent fake signal, clean it up */ spin_unlock_irq(¤t->sighand->siglock); - while (frozen(current)) { - current->state = TASK_UNINTERRUPTIBLE; + for (;;) { + set_current_state(TASK_UNINTERRUPTIBLE); + if (!frozen(current)) + break; schedule(); } pr_debug("%s left refrigerator\n", current->comm); |