提交 433ecb4a 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

fix refrigerator() vs thaw_process() race

refrigerator() can miss a wakeup, "wait event" loop needs a proper memory
ordering.
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Acked-by: N"Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册