All of lore.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>,
	uclinux-dist-devel@blackfin.uclinux.org,
	linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: freezer: should barriers be smp ?
Date: Thu, 14 Apr 2011 01:12:29 +0200	[thread overview]
Message-ID: <201104140112.29210.rjw@sisk.pl> (raw)
In-Reply-To: <BANLkTi=_+kYvs3_dsXifd_rkxfmFzJLttA@mail.gmail.com>

On Thursday, April 14, 2011, Mike Frysinger wrote:
> On Wed, Apr 13, 2011 at 18:49, Rafael J. Wysocki wrote:
> > On Thursday, April 14, 2011, Mike Frysinger wrote:
> >> i guess the trouble for us is that you have one CPU posting writes to
> >> task->flags (and doing so by grabbing the task's spinlock), but the
> >> other CPU is simply reading those flags.  there are no SMP barriers in
> >> between the read and write steps, nor is the reading CPU grabbing any
> >> locks which would be an implicit SMP barrier.  since the Blackfin SMP
> >> port lacks hardware cache coherency, there is no way for us to know
> >> "we've got to sync the caches before we can do this read".  by using
> >> the patch i posted above, we have that signal and so things work
> >> correctly.,
> >
> > In theory I wouldn't expect the patch to work correctly, because it replaces
> > _stronger_ memory barriers with _weaker_ SMP barriers.  However, looking at
> > the blackfin's definitions of SMP barriers I see that it uses extra stuff that
> > should _also_ be used in the definitions of the mandatory barriers.
> >
> > In my opinion is an architecture problem, not the freezer code problem.
> 
> OK, we have a patch pending locally which populates all barriers with
> this logic, but based on my understanding of things, that didnt seem
> correct.  i guess i'm reading too much into the names ... i'd expect
> the opposite behavior where "rmb" is only for UP needs while "smp_rmb"
> is a rmb which additionally covers SMP.

Well, I guess the naming is for historical reasons, ie. mb(), rmb() and wmb()
were there first and it probably was regarded cleaner to use new names for the
optimized smp_ variants than to rename all instances already in the code and
then repurpose the old names.

Thanks,
Rafael

  parent reply	other threads:[~2011-04-13 23:12 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13  6:14 freezer: should barriers be smp ? Mike Frysinger
2011-04-13 20:58 ` Rafael J. Wysocki
2011-04-13 20:58 ` Rafael J. Wysocki
2011-04-13 21:02   ` Mike Frysinger
2011-04-13 21:05     ` Pavel Machek
2011-04-13 21:05     ` Pavel Machek
2011-04-13 21:11       ` [uclinux-dist-devel] " Mike Frysinger
2011-04-13 21:53         ` Rafael J. Wysocki
2011-04-13 21:53         ` Rafael J. Wysocki
2011-04-13 22:11           ` Alan Stern
2011-04-13 22:11           ` [linux-pm] " Alan Stern
2011-04-13 22:34             ` [linux-pm] [uclinux-dist-devel] freezer: should barriers be smp? Rafael J. Wysocki
2011-04-14 14:55               ` Alan Stern
2011-04-14 22:34                 ` Rafael J. Wysocki
2011-04-14 22:34                 ` [linux-pm] " Rafael J. Wysocki
2011-04-15 14:32                   ` Alan Stern
2011-04-15 14:32                   ` Alan Stern
2011-04-14 14:55               ` Alan Stern
2011-04-13 22:34             ` Rafael J. Wysocki
2011-04-13 22:22           ` [uclinux-dist-devel] freezer: should barriers be smp ? Mike Frysinger
2011-04-13 22:49             ` Rafael J. Wysocki
2011-04-13 22:53               ` Rafael J. Wysocki
2011-04-13 22:53               ` Rafael J. Wysocki
2011-04-13 22:57               ` Mike Frysinger
2011-04-13 22:57               ` Mike Frysinger
2011-04-13 23:12                 ` Rafael J. Wysocki
2011-04-13 23:12                 ` Rafael J. Wysocki [this message]
2011-04-14 15:13                 ` Alan Stern
2011-04-14 15:13                 ` [linux-pm] " Alan Stern
2011-04-14 22:40                   ` Rafael J. Wysocki
2011-04-14 22:40                   ` [linux-pm] " Rafael J. Wysocki
2011-04-13 22:49             ` [uclinux-dist-devel] " Rafael J. Wysocki
2011-04-13 22:22           ` Mike Frysinger
2011-04-13 22:04         ` [linux-pm] " Alan Stern
2011-04-15 16:29           ` Pavel Machek
2011-04-15 16:33             ` [uclinux-dist-devel] [linux-pm] " Mike Frysinger
2011-04-15 16:57               ` Pavel Machek
2011-04-15 16:57               ` [uclinux-dist-devel] " Pavel Machek
2011-04-15 23:11               ` Rafael J. Wysocki
2011-04-15 23:11               ` [uclinux-dist-devel] [linux-pm] " Rafael J. Wysocki
2011-04-15 23:24                 ` [uclinux-dist-devel] " Mike Frysinger
2011-04-15 23:24                 ` [uclinux-dist-devel] [linux-pm] " Mike Frysinger
2011-04-15 23:30                   ` [uclinux-dist-devel] " Rafael J. Wysocki
2011-04-15 23:30                   ` [uclinux-dist-devel] [linux-pm] " Rafael J. Wysocki
2011-04-15 16:33             ` [uclinux-dist-devel] " Mike Frysinger
2011-04-15 16:29           ` Pavel Machek
2011-04-13 22:04         ` Alan Stern
2011-04-13 21:11       ` Mike Frysinger
2011-04-13 21:02   ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2011-04-13  6:14 Mike Frysinger

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=201104140112.29210.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=uclinux-dist-devel@blackfin.uclinux.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.