Received: by 10.192.165.148 with SMTP id m20csp345807imm; Fri, 4 May 2018 11:09:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrS0TnwrkKyRYId86mzcfYpGJIjMFp7WOtGjS8q3YonFCb+sVEpzH2zkwtf/3vLnuEbLJ0+ X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr28415386pld.163.1525457384640; Fri, 04 May 2018 11:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525457384; cv=none; d=google.com; s=arc-20160816; b=qDTUzV8ruwYIpuwRpKU+tpRC2L0afB27ajTtMPd5IZhTTAna+ujGbppdc5nKOV9RcE 1A/QnhT5BY0AMASuj2ktvCRATemPu0TjpUCyK0jr62+JHcOIBVnyifTRsUzCDpMGKEUn GIQzUAKOYSR0atK7DQSp+hf+jUlGE4DqYKI1xU0n4ev3ggXegsXYefHe6bogMhhA3BVQ 5L2KINblP6kVSGO8kr48i2zcNBancLyI34S9Ufl9E2jCc7ewZxkTZG6DhpCInSruOe0i oxwQqDqUE58ZvDNG1ryL66YHmlmjziaqhvbbeJRA1Yzdk4MosfeYXSIvyFmqn4z8zRXp qjAw== 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=D4O6OX2nhzwGYRSydBi/SfRg6r1E3lgdDWd0Pp8e//A=; b=ScZqfyj7GRXqx84W/HUpTMLwahXjMUiaaRwmzuKspSf+Bngm0/HlD5lmOo9iKhMjH6 bnVX3dlVc1sdn9igu9WxHD3mMN9Ln/++MsKRob8knnShnlsSMhdHWvaaR6j8FKsSz8rD 9HuawhmhEB+sSYVWyEAh6Gjnq26L3CRbZIIaE5hnFrN8va4StWgBu7QqZMBMUVF7Y84A 5u9SMxVkGjl6M7LtwQPjs193VSgmU2qxvaoXNMX6Dat3b4hQnZzKWJNr1naIdg9z45B3 bMeBhPcyxV06bKLqROXjYVcgrCsCbHnlmQ+z9Yes8yCkgaR/2XxJdNRKzQQ+T3rsczTX yn9Q== 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 q15-v6si6366897pgt.266.2018.05.04.11.09.29; Fri, 04 May 2018 11:09:44 -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 S1751632AbeEDSJT (ORCPT + 99 others); Fri, 4 May 2018 14:09:19 -0400 Received: from foss.arm.com ([217.140.101.70]:57866 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558AbeEDSJS (ORCPT ); Fri, 4 May 2018 14:09: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 02F821529; Fri, 4 May 2018 11:09: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 5B82F3F487; Fri, 4 May 2018 11:09:16 -0700 (PDT) Date: Fri, 4 May 2018 19:09:09 +0100 From: Mark Rutland To: Peter Zijlstra Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, boqun.feng@gmail.com, catalin.marinas@arm.com, dvyukov@google.com, mingo@kernel.org, will.deacon@arm.com Subject: Re: [PATCH 1/6] locking/atomic, asm-generic: instrument ordering variants Message-ID: <20180504180909.dnhfflibjwywnm4l@lakrids.cambridge.arm.com> References: <20180504173937.25300-1-mark.rutland@arm.com> <20180504173937.25300-2-mark.rutland@arm.com> <20180504180105.GS12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180504180105.GS12217@hirez.programming.kicks-ass.net> 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 Fri, May 04, 2018 at 08:01:05PM +0200, Peter Zijlstra wrote: > On Fri, May 04, 2018 at 06:39:32PM +0100, Mark Rutland wrote: > > Currently only instruments the fully > > ordered variants of atomic functions, ignoring the {relaxed,acquire,release} > > ordering variants. > > > > This patch reworks the header to instrument all ordering variants of the atomic > > functions, so that architectures implementing these are instrumented > > appropriately. > > > > To minimise repetition, a macro is used to generate each variant from a common > > template. The {full,relaxed,acquire,release} order variants respectively are > > then built using this template, where the architecture provides an > > implementation. > > include/asm-generic/atomic-instrumented.h | 1195 ++++++++++++++++++++++++----- > > 1 file changed, 1008 insertions(+), 187 deletions(-) > > Is there really no way to either generate or further macro compress this? I can definitely macro compress this somewhat, but the bulk of the repetition will be the ifdeffery, which can't be macro'd away IIUC. Generating this with a script is possible -- do we do anything like that elsewhere? > This is stupid repetitive, we just got rid of all that endless copy > paste crap in atomic implementations and now we're going back to that. > > Adding or changing atomic bits becomes horrifically painful because of this. Sure thing; mangling it to its current state was a pain enough. Thanks, Mark.