Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);