public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Mike Frysinger <vapier@gentoo.org>
Cc: Pavel Machek <pavel@ucw.cz>,
	linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org
Subject: Re: [PATCH] freezer: use smp barriers
Date: Mon, 25 Apr 2011 12:38:35 +0200	[thread overview]
Message-ID: <201104251238.36005.rjw@sisk.pl> (raw)
In-Reply-To: <1303716665-27584-1-git-send-email-vapier@gentoo.org>

On Monday, April 25, 2011, Mike Frysinger wrote:
> 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>

Applied to suspend-2.6/linux-next.

Thanks,
Rafael


> ---
>  kernel/freezer.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/freezer.c b/kernel/freezer.c
> index 66ecd2e..7b01de9 100644
> --- a/kernel/freezer.c
> +++ b/kernel/freezer.c
> @@ -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;
>  
> 


      parent reply	other threads:[~2011-04-25 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-25  7:31 [PATCH] freezer: use smp barriers Mike Frysinger
2011-04-25  8:38 ` Pavel Machek
2011-04-25 10:38 ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201104251238.36005.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox