From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures Date: Tue, 14 Aug 2007 16:14:21 -0700 (PDT) Message-ID: References: <20070809131423.GA9927@shell.boston.redhat.com> <46C2350A.1010807@redhat.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Satyam Sharma , Linux Kernel Mailing List , linux-arch@vger.kernel.org, torvalds@linux-foundation.org, netdev@vger.kernel.org, Andrew Morton , ak@suse.de, heiko.carstens@de.ibm.com, davem@davemloft.net, schwidefsky@de.ibm.com, wensong@linux-vs.org, horms@verge.net.au, wjiang@resilience.com, cfriesen@nortel.com, zlynx@acm.org, rpjday@mindspring.com, jesper.juhl@gmail.com, segher@kernel.crashing.org To: Chris Snook Return-path: In-Reply-To: <46C2350A.1010807@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, 14 Aug 2007, Chris Snook wrote: > Because atomic operations are generally used for synchronization, which > requires volatile behavior. Most such codepaths currently use an inefficient > barrier(). Some forget to and we get bugs, because people assume that > atomic_read() actually reads something, and atomic_write() actually writes > something. Worse, these are architecture-specific, even compiler > version-specific bugs that are often difficult to track down. Looks like we need to have lock and unlock semantics? atomic_read() which has no barrier or volatile implications. atomic_read_for_lock Acquire semantics? atomic_read_for_unlock Release semantics?