Freezer: Use SMP barriers
authorMike Frysinger <vapier@gentoo.org>
Mon, 25 Apr 2011 10:33:15 +0000 (12:33 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 17 May 2011 21:19:17 +0000 (23:19 +0200)
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 <vapier@gentoo.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
kernel/freezer.c

index 66ecd2ead215a9cb88ca8ae9f674e1c82766a066..7b01de98bb6a97aea6e1d5b99f38b113c099b780 100644 (file)
@@ -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);
 }
@@ -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;