Skip to content

Commit

Permalink
[PATCH] remove busywait in refrigerator
Browse files Browse the repository at this point in the history
This should make refrigerator sleep properly, not busywait after the first
schedule() returns.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Pavel Machek authored and Linus Torvalds committed Sep 5, 2005
1 parent 52fdd08 commit 2a23b5d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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("=");

Expand All @@ -47,8 +46,10 @@ void refrigerator(void)
recalc_sigpending(); /* We sent fake signal, clean it up */
spin_unlock_irq(&current->sighand->siglock);

while (frozen(current))
while (frozen(current)) {
current->state = TASK_UNINTERRUPTIBLE;
schedule();
}
pr_debug("%s left refrigerator\n", current->comm);
current->state = save;
}
Expand Down

0 comments on commit 2a23b5d

Please sign in to comment.