From: Pavel Machek Date: Sat, 3 Sep 2005 22:56:53 +0000 (-0700) Subject: [PATCH] remove busywait in refrigerator X-Git-Tag: v2.6.14-rc1~841 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a23b5d1e119fd10e25b8e93464c8d549f5a5c5d;p=linux-2.6 [PATCH] remove busywait in refrigerator This should make refrigerator sleep properly, not busywait after the first schedule() returns. Signed-off-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/process.c b/kernel/power/process.c index 3bd0d26181..f7da5bfc91 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -38,7 +38,6 @@ void refrigerator(void) processes around? */ long save; save = current->state; - current->state = TASK_UNINTERRUPTIBLE; pr_debug("%s entered refrigerator\n", current->comm); printk("="); @@ -47,8 +46,10 @@ void refrigerator(void) recalc_sigpending(); /* We sent fake signal, clean it up */ spin_unlock_irq(¤t->sighand->siglock); - while (frozen(current)) + while (frozen(current)) { + current->state = TASK_UNINTERRUPTIBLE; schedule(); + } pr_debug("%s left refrigerator\n", current->comm); current->state = save; }