From: Ralf Baechle <ralf@linux-mips.org>
To: David Daney <ddaney@caviumnetworks.com>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] MIPS: Octeon: Use optimized memory barrier primitives.
Date: Wed, 13 Jan 2010 13:33:34 +0100 [thread overview]
Message-ID: <20100113123334.GB20354@linux-mips.org> (raw)
In-Reply-To: <1262999864-2353-2-git-send-email-ddaney@caviumnetworks.com>
On Fri, Jan 08, 2010 at 05:17:44PM -0800, David Daney wrote:
> In order to achieve correct synchronization semantics, the Octeon port
> had defined CONFIG_WEAK_REORDERING_BEYOND_LLSC. This resulted in code
> that looks like:
>
> sync
> ll ...
> .
> .
> .
> sc ...
> .
> .
> sync
>
> The second SYNC was redundant, but harmless.
>
> Octeon has a SYNCW instruction that acts as a write-memory-barrier
> (due to an erratum in some parts two SYNCW are used). It is much
> faster than SYNC because it imposes ordering on the writes, but
> doesn't otherwise stall the execution pipeline. On Octeon, SYNC
> stalls execution until all preceeding writes are committed to the
> coherent memory system.
>
> Using:
>
> syncw;syncw
> ll
> .
> .
> .
> sc
> .
> .
>
> Has identical semantics to the first sequence, but is much faster.
> The SYNCW orders the writes, and the SC will not complete successfully
> until the write is committed to the coherent memory system. So at the
> end all preceeding writes have been committed. Since Octeon does not
> do speculative reads, this functions as a full barrier.
>
> The patch removes CONFIG_WEAK_REORDERING_BEYOND_LLSC, and substitutes
> SYNCW for SYNC in write-memory-barriers.
Queued for 2.6.34. Thanks!
Ralf
prev parent reply other threads:[~2010-01-13 12:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-09 1:16 [PATCH 0/2] Rearrange MIPS barriers and optimize for Octeon David Daney
2010-01-09 1:17 ` [PATCH 1/2] MIPS: New macro smp_mb__before_llsc David Daney
2010-01-13 12:32 ` Ralf Baechle
2010-01-09 1:17 ` [PATCH 2/2] MIPS: Octeon: Use optimized memory barrier primitives David Daney
2010-01-13 12:33 ` Ralf Baechle [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=20100113123334.GB20354@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=ddaney@caviumnetworks.com \
--cc=linux-mips@linux-mips.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).