From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756122AbdC2Nh7 (ORCPT ); Wed, 29 Mar 2017 09:37:59 -0400 Received: from foss.arm.com ([217.140.101.70]:33842 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755269AbdC2Nh6 (ORCPT ); Wed, 29 Mar 2017 09:37:58 -0400 Date: Wed, 29 Mar 2017 14:37:36 +0100 From: Mark Rutland To: Dmitry Vyukov Cc: Peter Zijlstra , Ingo Molnar , Andrew Morton , Will Deacon , Andrey Ryabinin , kasan-dev , LKML , "x86@kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 5/8] x86: switch atomic.h to use atomic-instrumented.h Message-ID: <20170329133736.GJ23442@leverpostej> References: <4d4bb87870e5d7b1a3c660c74a1cd474def20e74.1490717337.git.dvyukov@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 28, 2017 at 06:25:07PM +0200, Dmitry Vyukov wrote: > On Tue, Mar 28, 2017 at 6:15 PM, Dmitry Vyukov wrote: > > #define __try_cmpxchg(ptr, pold, new, size) \ > > __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX) > > > > -#define try_cmpxchg(ptr, pold, new) \ > > +#define arch_try_cmpxchg(ptr, pold, new) \ > > __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr))) > > Is try_cmpxchg() a part of public interface like cmpxchg, or only a > helper to implement atomic_try_cmpxchg()? > If it's the latter than we don't need to wrap them. De-facto, it's an x86-specific helper. It was added in commit: a9ebf306f52c756c ("locking/atomic: Introduce atomic_try_cmpxchg()") ... which did not add try_cmpxchg to any generic header. If it was meant to be part of the public interface, we'd need a generic definition. Thanks, Mark. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id 8B7626B039F for ; Wed, 29 Mar 2017 09:37:59 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id n11so7325964pfg.7 for ; Wed, 29 Mar 2017 06:37:59 -0700 (PDT) Received: from foss.arm.com (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id s36si7521794pld.3.2017.03.29.06.37.58 for ; Wed, 29 Mar 2017 06:37:58 -0700 (PDT) Date: Wed, 29 Mar 2017 14:37:36 +0100 From: Mark Rutland Subject: Re: [PATCH 5/8] x86: switch atomic.h to use atomic-instrumented.h Message-ID: <20170329133736.GJ23442@leverpostej> References: <4d4bb87870e5d7b1a3c660c74a1cd474def20e74.1490717337.git.dvyukov@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Dmitry Vyukov Cc: Peter Zijlstra , Ingo Molnar , Andrew Morton , Will Deacon , Andrey Ryabinin , kasan-dev , LKML , "x86@kernel.org" , "linux-mm@kvack.org" On Tue, Mar 28, 2017 at 06:25:07PM +0200, Dmitry Vyukov wrote: > On Tue, Mar 28, 2017 at 6:15 PM, Dmitry Vyukov wrote: > > #define __try_cmpxchg(ptr, pold, new, size) \ > > __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX) > > > > -#define try_cmpxchg(ptr, pold, new) \ > > +#define arch_try_cmpxchg(ptr, pold, new) \ > > __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr))) > > Is try_cmpxchg() a part of public interface like cmpxchg, or only a > helper to implement atomic_try_cmpxchg()? > If it's the latter than we don't need to wrap them. De-facto, it's an x86-specific helper. It was added in commit: a9ebf306f52c756c ("locking/atomic: Introduce atomic_try_cmpxchg()") ... which did not add try_cmpxchg to any generic header. If it was meant to be part of the public interface, we'd need a generic definition. Thanks, Mark. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org