From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508AbdCPSpi (ORCPT ); Thu, 16 Mar 2017 14:45:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58804 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668AbdCPSpf (ORCPT ); Thu, 16 Mar 2017 14:45:35 -0400 Date: Thu, 16 Mar 2017 11:45:29 -0700 From: Andrew Morton To: Andi Kleen Cc: Dmitry Vyukov , 20170315021431.13107-3-andi@firstfloor.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , "linux-mm@kvack.org" , "x86@kernel.org" , LKML Subject: Re: [mmotm] "x86/atomic: move __arch_atomic_add_unless out of line" build error Message-Id: <20170316114529.b94234511ed04faf3605a364@linux-foundation.org> In-Reply-To: <20170316164110.GK32070@tassilo.jf.intel.com> References: <20170316044704.GA729@jagdpanzerIV.localdomain> <20170316164110.GK32070@tassilo.jf.intel.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Mar 2017 09:41:10 -0700 Andi Kleen wrote: > > Andi, why did you completely remove __arch_atomic_add_unless() from > > the header? Don't we need at least a declaration there? > > Actually it's there in my git version: > > I wonder where it disappeared. > > -/** > - * __atomic_add_unless - add unless the number is already a given value > - * @v: pointer of type atomic_t > - * @a: the amount to add to v... > - * @u: ...unless v is equal to u. > - * > - * Atomically adds @a to @v, so long as @v was not already @u. > - * Returns the old value of @v. > - */ > -static __always_inline int __atomic_add_unless(atomic_t *v, int a, int u) > -{ > - int c, old; > - c = atomic_read(v); > - for (;;) { > - if (unlikely(c == (u))) > - break; > - old = atomic_cmpxchg((v), c, c + (a)); > - if (likely(old == c)) > - break; > - c = old; > - } > - return c; > -} > +int __atomic_add_unless(atomic_t *v, int a, int u); That was me fixing rejects (from asm-generic-x86-wrap-atomic-operations.patch), incompletely. --- a/arch/x86/include/asm/atomic.h~x86-atomic-move-__atomic_add_unless-out-of-line-fix +++ a/arch/x86/include/asm/atomic.h @@ -235,6 +235,8 @@ ATOMIC_OPS(xor, ^) #undef ATOMIC_FETCH_OP #undef ATOMIC_OP +int __arch_atomic_add_unless(atomic_t *v, int a, int u); + /** * arch_atomic_inc_short - increment of a short integer * @v: pointer to type int