Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757336AbXELFmR (ORCPT ); Sat, 12 May 2007 01:42:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751696AbXELFmD (ORCPT ); Sat, 12 May 2007 01:42:03 -0400 Received: from terminus.zytor.com ([192.83.249.54]:40370 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbXELFmB (ORCPT ); Sat, 12 May 2007 01:42:01 -0400 Message-ID: <46455394.6020302@zytor.com> Date: Fri, 11 May 2007 22:41:40 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.0 (X11/20070419) MIME-Version: 1.0 To: Satyam Sharma CC: Jonathan Corbet , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Johannes Stezenbach , Jesper Juhl , Randy Dunlap , Heikki Orsila , jimmy bahuleyan , Stefan Richter Subject: Re: [PATCH] "volatile considered harmful", take 3 References: <12700.1178905000@lwn.net> <464551D5.2050709@zytor.com> In-Reply-To: <464551D5.2050709@zytor.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 845 Lines: 21 H. Peter Anvin wrote: > > I don't see why Alan's way is necessarily better; it should work but is > more heavy-handed as it's disabling *all* optimization such as loop > invariants across the barrier. > To expand on this further: the way this probably *should* be handled, Linux-style, is with internally-volatile versions of le32_to_cpup() and friends. That obeys the concept that the volatility should be associated with an operation, not a data structure, and, being related to an I/O device, should have its endianness explicitly declared. Right now those macros don't exist, however. -hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/