From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964788AbWGHKZT (ORCPT ); Sat, 8 Jul 2006 06:25:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932328AbWGHKZT (ORCPT ); Sat, 8 Jul 2006 06:25:19 -0400 Received: from www.osadl.org ([213.239.205.134]:56740 "EHLO mail.tglx.de") by vger.kernel.org with ESMTP id S932327AbWGHKZR (ORCPT ); Sat, 8 Jul 2006 06:25:17 -0400 Subject: Re: [patch] spinlocks: remove 'volatile' From: Thomas Gleixner Reply-To: tglx@linutronix.de To: Avi Kivity Cc: Arjan van de Ven , Linus Torvalds , Mark Lord , "linux-os (Dick Johnson)" , Ingo Molnar , Andrew Morton , linux-kernel@vger.kernel.org In-Reply-To: <44AF8668.2070306@argo.co.il> References: <1152352309.3120.15.camel@laptopd505.fenrus.org> <44AF8668.2070306@argo.co.il> Content-Type: text/plain Date: Sat, 08 Jul 2006 12:28:06 +0200 Message-Id: <1152354486.24611.316.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2006-07-08 at 13:18 +0300, Avi Kivity wrote: > I didn't suggest the compiler could or should do it, just that it would > be possible (for the _user_) to write portable ISO C code to access PCI > mmio registers, if volatile's implementation serialized access. And how is this portable on complex multibus architectures, where the PCI access goes through a couple of transports before hitting the PCI hardware ? volatile has no notion of serialization. volatile guarantees that the compiler does not optimize and cache seemingly static values, i.e. it disables compiler optimizations. tglx