From: Andrea Arcangeli <andrea@suse.de>
To: Paul McKenney <Paul.McKenney@us.ibm.com>
Cc: Peter Rival <frival@zk3.dec.com>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Jay.Estabrook@compaq.com, linux-kernel@vger.kernel.org,
lse-tech@lists.sourceforge.net,
Richard Henderson <rth@twiddle.net>,
cardoza@zk3.dec.com, woodward@zk3.dec.com
Subject: Re: [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion
Date: Wed, 10 Oct 2001 18:58:48 +0200 [thread overview]
Message-ID: <20011010185848.D726@athlon.random> (raw)
In-Reply-To: <OF206EE8AA.7A83A16B-ON88256AE1.005467E3@boulder.ibm.com>
In-Reply-To: <OF206EE8AA.7A83A16B-ON88256AE1.005467E3@boulder.ibm.com>; from Paul.McKenney@us.ibm.com on Wed, Oct 10, 2001 at 08:24:11AM -0700
On Wed, Oct 10, 2001 at 08:24:11AM -0700, Paul McKenney wrote:
> which states:
>
> For instance, your producer must issue a "memory barrier" instruction
> after writing the data to shared memory and before inserting it on
> the queue; likewise, your consumer must issue a memory barrier
> instruction after removing an item from the queue and before reading
> from its memory. Otherwise, you risk seeing stale data, since,
> while the Alpha processor does provide coherent memory, it does
> not provide implicit ordering of reads and writes. (That is, the
> write of the producer's data might reach memory after the write of
> the queue, such that the consumer might read the new item from the
> queue but get the previous values from the item's memory.
>
> Note that they require a memory barrier (rmb()) between the time the
> item is removed from the queue and the time that the data in the item
> is referenced, despite the fact that there is a data dependency between
> the dequeueing and the dereferencing. So, again, data dependency does
> -not- substitute for an MB on Alpha.
This is very explicit indeed.
In short I guess what happens is that the reader may have old data in
its cache, and the rmb() makes sure the cache used after the rmb() is
not older than the cache used before the rmb().
However the more I think about it the more I suspect we'd better use
rmb() in all readers in the common code, rather than defining rmbdd with
IPI on alpha, maybe alpha after all isn't the only one that needs the
rmb() but it's the only one defining the behaviour in detail? I can very
well imagine other archs also not invalidating all caches of all other
cpus after a write followed by wmb, the synchronization can be delayed
safely if the other cpus are readers, and they didn't issued an explicit
rmb. So what alpha is doing can really be seen as a "feature" that
allows to delay synchronization of caches after writes and wmb, unless
an explicit order is requested by the reader via rmb (or better mb on alpha).
The fact is that if there's old data in cache, a data dependency isn't
different than non data dependency if the cpu caches aren't synchronized
or invalidated during wmb run by the producer.
Andrea
next prev parent reply other threads:[~2001-10-10 16:59 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-10 15:24 [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul McKenney
2001-10-10 16:58 ` Andrea Arcangeli [this message]
2001-10-10 17:25 ` Linus Torvalds
2001-10-12 5:06 ` Rusty Russell
2001-10-12 16:28 ` Linus Torvalds
2001-10-12 19:50 ` Al Dunsmuir
2001-10-13 1:07 ` Paul Mackerras
2001-10-13 1:54 ` Davide Libenzi
2001-10-13 2:04 ` Linus Torvalds
2001-10-13 2:31 ` Davide Libenzi
2001-10-13 2:46 ` Davide Libenzi
2001-10-13 3:30 ` Linus Torvalds
2001-10-13 2:49 ` Paul Mackerras
2001-10-13 14:11 ` Re: RFC: patch to allow lock-free traversal of lists Paul E. McKenney
2001-10-13 2:00 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Linus Torvalds
2001-10-13 13:54 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists Alan Cox
2001-10-13 7:38 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Rusty Russell
2001-10-13 16:28 ` Re: RFC: patch to allow lock-free traversal of lists with insertion ^M Paul E. McKenney
2001-10-13 21:23 ` Rusty Russell
2001-10-12 5:43 ` [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with Albert D. Cahalan
2001-10-12 6:26 ` Paul Mackerras
2001-10-12 8:28 ` Alex Bligh - linux-kernel
2001-10-12 8:51 ` Jonathan Lundell
-- strict thread matches above, loose matches on Subject: below --
2001-10-13 14:42 [Lse-tech] Re: RFC: patch to allow lock-free traversal of lists with insertion Paul McKenney
2001-10-13 17:23 ` Linus Torvalds
2001-10-13 17:28 ` Linus Torvalds
2001-10-14 7:25 ` Dipankar Sarma
2001-10-13 18:42 ` Andi Kleen
2001-10-13 19:15 ` Alexander Viro
2001-10-13 20:44 ` Rusty Russell
2001-10-13 21:19 ` Rusty Russell
2001-10-11 10:34 Dipankar Sarma
2001-10-10 21:44 Paul McKenney
2001-10-10 16:00 Paul McKenney
2001-10-10 10:06 Dipankar Sarma
2001-10-10 10:18 ` Linus Torvalds
2001-10-10 11:43 ` Dipankar Sarma
2001-10-12 3:27 ` Rusty Russell
2001-10-12 16:56 ` Linus Torvalds
2001-10-12 18:53 ` Dipankar Sarma
2001-10-13 7:25 ` Rusty Russell
[not found] <20011010182730.0077454b.rusty@rustcorp.com.au>
2001-10-10 9:36 ` Linus Torvalds
2001-10-11 6:50 ` Rusty Russell
2001-10-10 7:58 Dipankar Sarma
2001-10-10 7:06 Dipankar Sarma
2001-10-10 7:21 ` BALBIR SINGH
2001-10-10 9:06 ` Dipankar Sarma
2001-10-10 6:54 Dipankar Sarma
2001-10-10 4:43 Paul McKenney
2001-10-09 15:45 Paul McKenney
2001-10-10 2:05 ` [Lse-tech] " Andrea Arcangeli
2001-10-10 5:05 ` Linus Torvalds
2001-10-10 5:17 ` BALBIR SINGH
2001-10-10 5:29 ` Davide Libenzi
2001-10-10 5:46 ` Linus Torvalds
2001-10-10 6:01 ` BALBIR SINGH
2001-10-10 15:23 ` Victor Yodaiken
2001-10-10 6:16 ` Paul Mackerras
2001-10-10 6:30 ` Linus Torvalds
2001-10-10 7:36 ` Paul Mackerras
2001-10-10 15:54 ` Victor Yodaiken
2001-10-10 21:56 ` Keith Owens
2001-10-10 22:24 ` Victor Yodaiken
2001-10-10 23:46 ` David S. Miller
2001-10-11 0:24 ` Davide Libenzi
2001-10-10 11:54 ` Keith Owens
2001-10-10 13:24 ` Ivan Kokshaysky
2001-10-10 13:41 ` Andrea Arcangeli
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=20011010185848.D726@athlon.random \
--to=andrea@suse.de \
--cc=Jay.Estabrook@compaq.com \
--cc=Paul.McKenney@us.ibm.com \
--cc=cardoza@zk3.dec.com \
--cc=frival@zk3.dec.com \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=rth@twiddle.net \
--cc=woodward@zk3.dec.com \
/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