Skip to content

Commit

Permalink
Freezer: Use SMP barriers
Browse files Browse the repository at this point in the history
The freezer processes are dealing with multiple threads running
simultaneously, and on a UP system, the memory reads/writes do
not need barriers to keep things in sync.  These are only needed
on SMP systems, so use SMP barriers instead.

Signed-off-by: Mike Frysinger <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
vapier authored and rjwysocki committed May 17, 2011
1 parent 3c43193 commit ee940d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static inline void frozen_process(void)
{
if (!unlikely(current->flags & PF_NOFREEZE)) {
current->flags |= PF_FROZEN;
wmb();
smp_wmb();
}
clear_freeze_flag(current);
}
Expand Down Expand Up @@ -93,7 +93,7 @@ bool freeze_task(struct task_struct *p, bool sig_only)
* the task as frozen and next clears its TIF_FREEZE.
*/
if (!freezing(p)) {
rmb();
smp_rmb();
if (frozen(p))
return false;

Expand Down

0 comments on commit ee940d8

Please sign in to comment.