Received: by 10.192.165.148 with SMTP id m20csp336833imm; Fri, 4 May 2018 11:01:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/EXI8/j2bYJwBBFcqiEtgQwtkDr9lsSv47jD02Q1k8Gx7k6iiAwrtkyT69pQ548UXsmJX X-Received: by 10.98.215.23 with SMTP id b23mr11279300pfh.5.1525456906803; Fri, 04 May 2018 11:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525456906; cv=none; d=google.com; s=arc-20160816; b=DhpRBkIoyZFu9QjiYOjcM7U9EN5H/6nwoEl9hj8byi2XWMJWQk2n1Q/QReh/4gq7xI Je3VHS95zIHU1Y5GeUlGHeRngzNqz1VQpCkW/e+t0l0pI9vUv4i6v/31an8f/TpX9QIT RDecLiCKrq9I9EAW1q8bPB+PJDP0X58M4nBt/CQJmq7jHdDZp2C0qqhZujelp7M3YBN7 Jv9hyjKoLX0TBhZGKN0WXZar8I7NLpwrhNr89bbGKOPzGXAkvNMT81LdalqJx+K8fFzR mg2amKYSOeTbuw1cMO7hQm5blQlLBba340Cs+QKgpBWNX429A/AwyvDcaWh8+D8hvlTR dn8g== 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:dkim-signature:arc-authentication-results; bh=+o76geI4dQf9zgy5QFKNUgbVXS0pHlMkfm4pLJmFhYM=; b=NtVG7XEWbI/pY2VB2BIf3MZaLrGxc2L0RvaQMyl/cloVgVD4DRtCmToRNgy5FJK7km zinbsd4JdyY7c5nh/T93DWbyVvewKYVBZzOPl2L7/baDUZnMTV0njjOPRXJgM1v1OM4y JHAoVjUwbFmdAo1ju25E5A+nfq/5Nw7J0RBVCHSMduQlYb7ahzBLzzz34gzrTn2POrCg vir6JPnTKr39fillWGT1t4BX5emrDz5WcwH91duNvugEZzIFZrRo3Q2pfkZttv7NIU6E sOPB4Vn1fig/kJR26zUbJ1H2JL9sjo6fcTOLgZjkotoiT3QrZNMmE/wDkyaLWRwwm/J3 8CPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QxDiGS9Y; 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 d132-v6si13646528pgc.253.2018.05.04.11.01.31; Fri, 04 May 2018 11:01:46 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QxDiGS9Y; 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 S1751573AbeEDSBL (ORCPT + 99 others); Fri, 4 May 2018 14:01:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57738 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbeEDSBK (ORCPT ); Fri, 4 May 2018 14:01:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+o76geI4dQf9zgy5QFKNUgbVXS0pHlMkfm4pLJmFhYM=; b=QxDiGS9Yd+g1oLnIOQFaMUYfG 5CVz0KGzLVOpDZyMqarVI/km1grdW8838YZ75V6dJ1bpk+MNtEZNM+HcZIv7gipRVuKAi2ZiQ7rth aARNX9b9VagAQHEMA/kNlK6/XDj2a70W/HcVTTyq6mFWFdPNWnSk9HKyYa0Q4irr+7FUeAM4ZcJqY LZEmytmAl0Mqm64x9Sl8cMWgJGDFNYOQMRCjPFGPNTxohZUiVVueJU80EE7kT9gq+IJRrxUgxkgab fHmYuqc0b40Fh7ElVn6ISV23XFmKUVfv/Pef1hTG7DhHNIdv+BkshFbq+1nPFQRKJczPi2zy3eCZB NccJ94QEw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEf11-0000Eu-Ij; Fri, 04 May 2018 18:01:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 787592029FA13; Fri, 4 May 2018 20:01:05 +0200 (CEST) Date: Fri, 4 May 2018 20:01:05 +0200 From: Peter Zijlstra To: Mark Rutland 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: <20180504180105.GS12217@hirez.programming.kicks-ass.net> References: <20180504173937.25300-1-mark.rutland@arm.com> <20180504173937.25300-2-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180504173937.25300-2-mark.rutland@arm.com> User-Agent: Mutt/1.9.5 (2018-04-13) 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 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. > > To stick to an 80 column limit while keeping the templates legible, the return > type and function name of each template are split over two lines. For > consistency, this is done even when not strictly necessary. > > Signed-off-by: Mark Rutland > Cc: Andrey Ryabinin > Cc: Boqun Feng > Cc: Dmitry Vyukov > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Will Deacon > --- > 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? 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.