Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280379
b: refs/heads/master
c: 5ece3ea
h: refs/heads/master
i:
  280377: f643673
  280375: faaaea9
v: v3
  • Loading branch information
Tejun Heo committed Nov 21, 2011
1 parent 14e6381 commit ba692ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96ee6d8539c9fc6742908d85eb9723abb5c91854
refs/heads/master: 5ece3eae4cdb968c269e0bc7e2c0e2b223552025
32 changes: 11 additions & 21 deletions trunk/kernel/freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,29 @@ bool __refrigerator(bool check_kthr_stop)
/* Hmm, should we be allowed to suspend when there are realtime
processes around? */
bool was_frozen = false;
long save;
long save = current->state;

/*
* No point in checking freezing() again - the caller already did.
* Proceed to enter FROZEN.
*/
spin_lock_irq(&freezer_lock);
repeat:
current->flags |= PF_FROZEN;
spin_unlock_irq(&freezer_lock);

save = current->state;
pr_debug("%s entered refrigerator\n", current->comm);

spin_lock_irq(&current->sighand->siglock);
recalc_sigpending(); /* We sent fake signal, clean it up */
spin_unlock_irq(&current->sighand->siglock);

for (;;) {
set_current_state(TASK_UNINTERRUPTIBLE);

spin_lock_irq(&freezer_lock);
current->flags |= PF_FROZEN;
if (!freezing(current) ||
(check_kthr_stop && kthread_should_stop()))
current->flags &= ~PF_FROZEN;
spin_unlock_irq(&freezer_lock);

if (!(current->flags & PF_FROZEN))
break;
was_frozen = true;
schedule();
}

/* leave FROZEN */
spin_lock_irq(&freezer_lock);
if (freezing(current))
goto repeat;
current->flags &= ~PF_FROZEN;
spin_unlock_irq(&freezer_lock);
spin_lock_irq(&current->sighand->siglock);
recalc_sigpending(); /* We sent fake signal, clean it up */
spin_unlock_irq(&current->sighand->siglock);

pr_debug("%s left refrigerator\n", current->comm);

Expand Down

0 comments on commit ba692ce

Please sign in to comment.