LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ayyappa Ch <ayyappa.ch.linux@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Clarification needed regarding memory barrier
Date: Wed, 18 Feb 2015 20:39:17 +0530	[thread overview]
Message-ID: <CAPyr0yLsDXpoA41=Y6PP-iVRnP_cGh-jmA1sDYECU1ZdCTwCYQ@mail.gmail.com> (raw)

Hello All,

I am reading memory-barrier.txt file as mentioned below.

Please clarify my doubt .
 1) For example if CPU1 got the lock , How PCI bridge can see STORE
*ADDR = 4  before STORE *DATA = 1?


ACQUIRES VS I/O ACCESSES
------------------------

Under certain circumstances (especially involving NUMA), I/O accesses within
two spinlocked sections on two different CPUs may be seen as interleaved by the
PCI bridge, because the PCI bridge does not necessarily participate in the
cache-coherence protocol, and is therefore incapable of issuing the required
read memory barriers.

For example:

CPU 1
===============================
spin_lock(Q)
writel(0, ADDR)
writel(1, DATA);
spin_unlock(Q);


CPU 2
===============================
spin_lock(Q);
writel(4, ADDR);
writel(5, DATA);
spin_unlock(Q);

may be seen by the PCI bridge as follows:

STORE *ADDR = 0, STORE *ADDR = 4, STORE *DATA = 1, STORE *DATA = 5

which would probably cause the hardware to malfunction.

Thanks and regards,
Ayyappa.Ch

                 reply	other threads:[~2015-02-18 15:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAPyr0yLsDXpoA41=Y6PP-iVRnP_cGh-jmA1sDYECU1ZdCTwCYQ@mail.gmail.com' \
    --to=ayyappa.ch.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Clarification needed regarding memory barrier' \
    /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

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