Commit 433ecb4a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

fix refrigerator() vs thaw_process() race

refrigerator() can miss a wakeup, "wait event" loop needs a proper memory
ordering.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Acked-by: default avatar"Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e87be114
......@@ -47,8 +47,10 @@ void refrigerator(void)
recalc_sigpending(); /* We sent fake signal, clean it up */
spin_unlock_irq(&current->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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment