Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753047AbaBXQky (ORCPT ); Mon, 24 Feb 2014 11:40:54 -0500 Received: from mail-vc0-f180.google.com ([209.85.220.180]:50372 "EHLO mail-vc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbaBXQkv (ORCPT ); Mon, 24 Feb 2014 11:40:51 -0500 MIME-Version: 1.0 In-Reply-To: References: <20140220083032.GN4250@linux.vnet.ibm.com> <20140220181116.GT4250@linux.vnet.ibm.com> <1392922421.28840.36.camel@triegel.csb> <1393095223.28840.4914.camel@triegel.csb> <20140223003933.GQ4250@linux.vnet.ibm.com> <20140223063426.GT4250@linux.vnet.ibm.com> Date: Mon, 24 Feb 2014 08:40:50 -0800 X-Google-Sender-Auth: oVee0W5yB6DHRSu1u4kZlbHywwA Message-ID: Subject: Re: [RFC][PATCH 0/5] arch: atomic rework From: Linus Torvalds To: Richard Biener Cc: Paul McKenney , Torvald Riegel , Will Deacon , Peter Zijlstra , Ramana Radhakrishnan , David Howells , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "mingo@kernel.org" , "gcc@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2014 at 8:37 AM, Linus Torvalds wrote: > > So yes, the atomic_read() would be ordered wrt '*ptr' (getting 'q') > _and_ '**ptr' (getting 'i'), but nothing else - including just the > aliasing access of dereferencing 'i' directly. Btw, what CPU architects and memory ordering guys tend to do in documentation is give a number of "litmus test" pseudo-code sequences to show the effects and intent of the language. I think giving those kinds of litmus tests for both "this is ordered" and "this is not ordered" cases like the above is would be a great clarification. Partly because the language is going to be somewhat legalistic and thus hard to wrap your mind around, and partly to really hit home the *intent* of the language, which I think is actually fairly clear to both compiler writers and to programmers. Linus -- 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/