Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp436912imm; Thu, 5 Jul 2018 03:00:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfVvWN9diUiZEvicT9O4ChbNTYHsC0aCSiKqWV49Ivev0v3Lthap8Vt1oZtPbtFSxU4wGgF X-Received: by 2002:a17:902:8f82:: with SMTP id z2-v6mr5492896plo.203.1530784831840; Thu, 05 Jul 2018 03:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530784831; cv=none; d=google.com; s=arc-20160816; b=u0BaSq+o82wD1yIfswHrI++cR1HoZRmTvhRmAcVSQDpJmWVZX5ulZLiMTIA8wxGvg+ McEFAAEcJSvgnWQw96y4H6ITeLPAsxTum9+mxZCUBpOcW/OgJDvinzwTKTNn6LdC1tgY KCremOS33JuXRrbT1BK4xB2gTuy0dB7NPaU/lzLTbeuuq/7V7NvSaPADfwmGOotkqx+r vDaNXyQzXKy2+++1fB++PvB5BT97x5RXFvR+1jUayZGhRrr7iu+FtSefGTLOjS9aqAxl 4OKqftgIc7BZYZUEWllwcjtbR5Zs09KGpgUYorgjO5LcehavD77nbhA9uLDivw9q5c/B hlVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=JAN8JqMODLLkvG4d39YXcIwM1B2XwtIDTYC5hn5IQB4=; b=q12h4rhrAaOKv169EY67xGMeJql/SjZjL6xw7hM3zEBWjdO/Kd1rVuKOHxsCfLDtwV 96bUJ0h1gsmIces/XdzUr+ucBZSVVEo6FYfrMIDuz68nWuUPVfEQEBbhQOl5zF35xsMJ LFd+DkNR9fK0OIe1CCiolM6/Mb4aGPhmxaYiFBDHvlCMhykXTh6uG3sDmUjzE73YOI7U frTyLeY/NlY5dMCDuS6v53RDsfCQR/JiXDLiAnu0Fct96OVtECGK5SLRt2QXDnu959wI tu6rYofGC7RdR0Zec1dbubp9lEBQ/giUFabEDFdSvczZJHcZQ1JCAcmboxiR10szV0sp QO1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 196-v6si5332881pgg.588.2018.07.05.03.00.17; Thu, 05 Jul 2018 03:00:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753602AbeGEJ6U (ORCPT + 99 others); Thu, 5 Jul 2018 05:58:20 -0400 Received: from foss.arm.com ([217.140.101.70]:46900 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753259AbeGEJ6S (ORCPT ); Thu, 5 Jul 2018 05:58:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B055F7A9; Thu, 5 Jul 2018 02:58:18 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9947C3F2EA; Thu, 5 Jul 2018 02:58:17 -0700 (PDT) Date: Thu, 5 Jul 2018 10:58:08 +0100 From: Mark Rutland To: Will Deacon Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, boqun.feng@gmail.com, Catalin Marinas Subject: Re: [PATCHv2 11/11] arm64: use instrumented atomics Message-ID: <20180705095759.sqvc2c5ofu7glyma@lakrids.cambridge.arm.com> References: <20180625105952.3756-1-mark.rutland@arm.com> <20180625105952.3756-12-mark.rutland@arm.com> <20180704152422.GK4828@arm.com> <20180704163721.lxuynjd4dflcyucm@lakrids.cambridge.arm.com> <20180704174133.GD9668@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180704174133.GD9668@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 04, 2018 at 06:41:34PM +0100, Will Deacon wrote: > On Wed, Jul 04, 2018 at 05:37:23PM +0100, Mark Rutland wrote: > > On Wed, Jul 04, 2018 at 04:24:22PM +0100, Will Deacon wrote: > > > This is mostly straightforward, but the cmpxchg/cmpxchg_double cases grow > > > an 'arch' prefix which suggests that they're part of the API with the core > > > atomics and also makes them horribly ugly. > > > > I agree this isn't nice. > > > > > This just looks to be an artifact of __LL_SC_CALL pasting that in. Can > > > you drop that auto pasting of 'arch', and instead change the > > > non-cmpxchg-case callers of the macro to include the arch prefix > > > instead, please? > > > > That leads to having an arch___llsc_ prefix in some cases, which is > > equally hideous. > > Yuck, how does that come about? > > > How about I remove the prefix mangling entirely, and always give > > functions an __llsc_ or __lse_ prefix. Then, unify the two in our > > atomic.h with: > > > > #ifdef CONFIG_ARM64_LSE > > #define ATOMIC_PFX __lse_ > > #else > > #define ATOMIC_PFX __ll_sc_ > > #endif > > > > #define arch_atomic_foo ATOMIC_PFX##atomic_foo > > #define arch_atomic_bar ATOMIC_PFX##atomic_bar > > > > ... which clearly delineates the implementation from core API. > > > > Does that sound ok to you? > > Why do we need two prefixes? The only reason we throw out __ll_sc_ at the > moment is so the out-of-line atomics have a different name from the inlined > ones. What I'd like is: > > atomic_foo > -> arch_atomic_foo > -> optionally calls __ll_sc_arch_atomic_foo > > which I think is very similar to what we already do (i.e. the inlined macro > is always called arch_atomic_foo, regardless of lse or ll/sc). Sure; so long as you're happy with __ll_sc_arch_atomic_foo, that works. I'll rework things to that effect for v3. Thanks, Mark.