From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <541B3ED6.8090606@xenomai.org> Date: Thu, 18 Sep 2014 22:21:42 +0200 From: Gilles Chanteperdrix MIME-Version: 1.0 References: <5357C92F.2060206@xenomai.org> <535828F6.6050308@xenomai.org> <53583DF7.3080700@xenomai.org> <540F6B15.2070201@xenomai.org> <54112EFA.4080901@web.de> <541130D0.50409@web.de> <541AC62F.2050003@xenomai.org> <541AC933.9090600@siemens.com> In-Reply-To: <541AC933.9090600@siemens.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] Reading /proc/xenomai/stat causes high latencies List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka , Jeroen Van den Keybus Cc: "xenomai@xenomai.org" On 09/18/2014 01:59 PM, Jan Kiszka wrote: > On 2014-09-18 13:46, Gilles Chanteperdrix wrote: >> (*) There is no guarantee that a CPU will see the correct order of >> effects from a second CPU's accesses, even _if_ the second CPU uses a >> memory barrier, unless the first CPU _also_ uses a matching memory >> barrier (see the subsection on "SMP Barrier Pairing"). > > [quick answer] > > ...or the architecture refrains from reordering write requests, like x86 > does. What may happen, though, is that the compiler reorders the writes. > Therefore you need at least a (must cheaper) compiler barrier on those > archs. See also linux/Documentation/memory-barriers.txt on this and more. The passage you quote is quoted from memory-barriers.txt, and I find it makes it pretty clear that the two barriers are needed for cache synchronization in the general case. Now, I read more in memory-barriers, and I do not find easily details about what the fact that x86 is "strictly ordered" means, and how it relaxes the constraints on what rules. Maybe you would care to give us the exact passage where this is mentioned? Also, I would welcome any detail about how SMP cache synchronization actually works on x86. -- Gilles.