提交 ee940d8d 编写于 作者: M Mike Frysinger 提交者: Rafael J. Wysocki

Freezer: Use SMP barriers

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: NMike Frysinger <vapier@gentoo.org>
Acked-by: NPavel Machek <pavel@ucw.cz>
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
上级 3c431936
...@@ -17,7 +17,7 @@ static inline void frozen_process(void) ...@@ -17,7 +17,7 @@ static inline void frozen_process(void)
{ {
if (!unlikely(current->flags & PF_NOFREEZE)) { if (!unlikely(current->flags & PF_NOFREEZE)) {
current->flags |= PF_FROZEN; current->flags |= PF_FROZEN;
wmb(); smp_wmb();
} }
clear_freeze_flag(current); clear_freeze_flag(current);
} }
...@@ -93,7 +93,7 @@ bool freeze_task(struct task_struct *p, bool sig_only) ...@@ -93,7 +93,7 @@ bool freeze_task(struct task_struct *p, bool sig_only)
* the task as frozen and next clears its TIF_FREEZE. * the task as frozen and next clears its TIF_FREEZE.
*/ */
if (!freezing(p)) { if (!freezing(p)) {
rmb(); smp_rmb();
if (frozen(p)) if (frozen(p))
return false; return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册