Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935842AbWK3LDV (ORCPT ); Thu, 30 Nov 2006 06:03:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935860AbWK3LDV (ORCPT ); Thu, 30 Nov 2006 06:03:21 -0500 Received: from mx1.redhat.com ([66.187.233.31]:8630 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S935842AbWK3LDU (ORCPT ); Thu, 30 Nov 2006 06:03:20 -0500 From: David Howells In-Reply-To: <20061130003506.GA1248@oleg> References: <20061130003506.GA1248@oleg> To: Oleg Nesterov Cc: Andrew Morton , David Howells , Alan Stern , "Paul E. McKenney" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] doc: atomic_add_unless() doesn't imply mb() on failure X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Thu, 30 Nov 2006 11:01:53 +0000 Message-ID: <11754.1164884513@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 830 Lines: 20 Oleg Nesterov wrote: > Most implementations of atomic_add_unless() can fail (return 0) after the > first atomic_read() (before cmpxchg). In that case we have a compiler > barrier only. Ummm... I wonder if we should instead change the behaviour of atomic_add_unless() to include an explicit smp_rmb() between the read and the conditional jump on all archs where this isn't already implied. Otherwise, what governs when the initial test going to be done by the CPU? Note that not all archs do cmpxchg() here, though I don't think that affects your argument. David - 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/