LKML Archive on
help / color / mirror / Atom feed
From: Lai Jiangshan <>
To: Ingo Molnar <>
Cc: Mathieu Desnoyers <>,
	Linux Kernel Mailing List <>
Subject: Re: [PATCH tip/tracing/markers] new probes manager
Date: Tue, 28 Oct 2008 09:17:52 +0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Ingo Molnar wrote:
> * Mathieu Desnoyers <> wrote:
>>> Do you have performance measurements for this ? On x86 it's a nop,
>>> AFAIK.
>> My statement above is inexact : x86_64 uses lfence for rmb(). But
>> numbers would still be welcome.
> yes, the statement that rmb() is very expensive looks dubious. It is 
> absolutely cheap everywhere.
> 	Ingo

On x86 it's _NOT_ a nop.

#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)

uses the "lock" prefix.

#define rmb()	asm volatile("lfence":::"memory")

uses the "lfence"

these two are harm for cache. rmb is exactly a expensive operator.

rmb() is indeed cheaper than any other atomic-operator(atomic, spin_lock .. etc)
everywhere. but In a fast path, avoiding rmb() is worthy.

		Thanx, Lai

      parent reply	other threads:[~2008-10-28  1:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-23  2:47 Lai Jiangshan
2008-10-27 15:58 ` Mathieu Desnoyers
2008-10-27 16:30   ` Mathieu Desnoyers
2008-10-27 18:26     ` Ingo Molnar
2008-10-27 23:13       ` Paul Mackerras
2008-10-28  1:17       ` Lai Jiangshan [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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH tip/tracing/markers] new probes manager' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).