kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com (Jim Cromie)
To: kernelnewbies@lists.kernelnewbies.org
Subject: where is __memory_barrier in kernel ?
Date: Sat, 12 Mar 2011 19:26:11 -0700	[thread overview]
Message-ID: <AANLkTi=z2_1Ds_xXPn3WeGoMwzU=DZFthyM5Q=RyQJ3X@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinrqSZN2wWsZsW0VV+X+eymXhQJKynFExwC3nxb@mail.gmail.com>

On Thu, Mar 10, 2011 at 8:13 AM, loody <miloody@gmail.com> wrote:

> hi
>
> 2011/3/8 piyush moghe <pmkernel@gmail.com>:
> > Yes what you are saying is also right, since in order to prevent the
> > ordering all the pending memory operations should have completed
> > hence as you mentioned processor stops and make sure all the memory
> > operations are completed.
> I am not sure whether all the memory operations are completed after
> cpu stops running for a while.
> I think there should be a more aggressive and precise instruction  to
> handle this behavior, right?
> appreciate your kind help,
> miloody


a consolidated view of locking primitives is in
linux-2.6.git/tools/perf/perf.h

it defines rmb(), cpu_relax() for many architectures in a single place.

the comment block here:
 http://lxr.free-electrons.com/source/arch/x86/include/asm/system.h#L357

lines 371-421, say that rmb is heavier than memory_barrier() or barrier().
I think the comment speaks to your "aggressive and precise" questions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110312/c8295070/attachment.html 

      parent reply	other threads:[~2011-03-13  2:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-06 14:02 where is __memory_barrier in kernel ? loody
2011-03-06 14:38 ` Михаил Кринкин
2011-03-08  6:20   ` piyush moghe
2011-03-08  6:29 ` Mulyadi Santosa
2011-03-08  6:38   ` piyush moghe
2011-03-10 15:13     ` loody
2011-03-10 16:51       ` Mulyadi Santosa
2011-03-13  2:26       ` Jim Cromie [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='AANLkTi=z2_1Ds_xXPn3WeGoMwzU=DZFthyM5Q=RyQJ3X@mail.gmail.com' \
    --to=jim.cromie@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).