linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: smuckle@codeaurora.org (Steve Muckle)
To: linux-arm-kernel@lists.infradead.org
Subject: IO access and *_relaxed macros
Date: Thu, 24 Mar 2011 11:22:11 -0700	[thread overview]
Message-ID: <4D8B8BD3.5070403@codeaurora.org> (raw)

Hi,

On ARMv7 the readl and writel macros (and readb, etc) include memory
barriers (dmb or dsb, unless defined otherwise by the machine) due to
CONFIG_ARM_DMA_MEM_BUFFERABLE being defined by default. Likewise the
ioread* and iowrite* macros also include memory barriers.

The barriers in the io accessor macros are only on one side, and the
reads and writes have them on different sides, so it's easy to slip up
if you're relying on these macros to perform memory barriers in certain
locations. They also have a noticeable effect on performance.

To obtain best performance in drivers it would seem appropriate to use
the *_relaxed io accessor macros which lack memory barriers and manage
the memory barriers directly, inserting them only when strictly
required. Usage of the *_relaxed macros doesn't seem to be especially
prevalent however so I thought I'd see if others had thoughts or
concerns on this.

thanks,
Steve

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

             reply	other threads:[~2011-03-24 18:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 18:22 Steve Muckle [this message]
2011-03-25 10:08 ` IO access and *_relaxed macros Catalin Marinas
2011-03-25 23:55   ` Steve Muckle

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=4D8B8BD3.5070403@codeaurora.org \
    --to=smuckle@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).