From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Howells Subject: Re: [RFC patch 08/18] cnt32_to_63 should use smp_rmb() Date: Fri, 07 Nov 2008 23:50:38 +0000 Message-ID: <9473.1226101838@redhat.com> References: <20081107053349.861709786@polymtl.ca> <20081107052336.652868737@polymtl.ca> <25257.1226055312@redhat.com> <20081107170902.GD22134@Krystal> Return-path: Received: from mx2.redhat.com ([66.187.237.31]:54291 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305AbYKGXvu (ORCPT ); Fri, 7 Nov 2008 18:51:50 -0500 In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Steven Rostedt Cc: dhowells@redhat.com, Mathieu Desnoyers , "Paul E. McKenney" , Linus Torvalds , akpm@linux-foundation.org, Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Nicolas Pitre , Ralf Baechle , benh@kernel.crashing.org, paulus@samba.org, David Miller , Ingo Molnar , Thomas Gleixner , linux-arch@vger.kernel.org Steven Rostedt wrote: > > I use smp_rmb() to do this on SMP systems (hrm, actually, a rmb() could > > be required so it works also on UP systems safely wrt interrupts). > > smp_rmb turns into a compiler barrier on UP and should prevent the below > description. Note that that does not guarantee that the two reads will be done in the order you want. The compiler barrier _only_ affects the compiler. It does not stop the CPU from doing the reads in any order it wants. You need something stronger than smp_rmb() if you need the reads to be so ordered. David