Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp934547imm; Tue, 15 May 2018 11:16:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo8fSxqHcnZjzVGe3lP1DgzZYGpksOzKp5gLYyYGUTvE0fPw5vzOtmjdvbn0r5GKVaHC/qf X-Received: by 2002:a65:64d9:: with SMTP id t25-v6mr12575851pgv.283.1526408210651; Tue, 15 May 2018 11:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408210; cv=none; d=google.com; s=arc-20160816; b=qd9dqiZvRTYsOFoNQshCd3BepD2Yv5NnXsxnT/922rkDf0/c1e1vcSgzIabWfqtykT nvq6WxQ8b8NcIZAiYRKa99rDGNyWgfY7TTHhPR0o7lZfIh91Y0igTfclIyFEf0YNaUhF s2nBbf+ZiPqCsN4Ugsozr5tFLfJkh+PEN5wyqtoaJKPG3v7499neqMPuyhNdrr62vtdJ qUYp5cP9HRo+c35Jn3+b9R98AUGie7aw++TYbDJZqI/dLZbH61fyi3avS1Rjs2r/cnPL ztDiMFQNN28mfZ5tfbYiC9w1GuYDwKHZrhFX9lKjT1p9BuPSNvwsVntrfuc5YIrlSPPx TV1g== 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=Eob/6Sy6AMu+vrAd4pBUZr/VYorID8As8t0EigK7wWI=; b=0e4FRWTd2mBZIvr5ozJk7vhQm/JJORyx1/azEs47LG6IXZp23xdF/MOsFz7xs2s7H8 8AgM5qFeTC+UZVQSt1ilErQUSgiGGqck6I+F2pHF4aot9DuneaNAfhnNOd1U/CBMr2m+ Y1UjNd1hUVgxRt8kl9E6dqWcTeR5uEXVisNniKzsSe/zOE4cFeC+vWbiB2Gv89QPfj7v UfD94g2UOQIsbpDQ17lxX5Vjz32zrrV9owI6rCAM0jP9mc8oyVFn7keC3ZykoC2RjwuX XaIs5/XenrjoN+tg5eoiqAPM9J9gLoLOMgadfHXMhPycDK2yAS24/Ed7LbSsz2yFyd+X yQYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=B0WFhvxl; 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 d65-v6si579659pfj.243.2018.05.15.11.16.35; Tue, 15 May 2018 11:16:50 -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=B0WFhvxl; 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 S1752825AbeEOSPU (ORCPT + 99 others); Tue, 15 May 2018 14:15:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42602 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752030AbeEOSPT (ORCPT ); Tue, 15 May 2018 14:15:19 -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=Eob/6Sy6AMu+vrAd4pBUZr/VYorID8As8t0EigK7wWI=; b=B0WFhvxlUKNEqSzh5UuctZNgW KiAVyyoX4NZbnSMsJJNrzIGR5ci5hECrXipLSu5ZU8BzQpjZXssrNE8xJgC4L2EkzYGVKyYw7ZRdP O9GzakjNJqxZIMr0W18jXDGyGo+y4hOu5Ig4rxaH/cOiOet6qn1QYFL1fTvTI396x+ZyxyPq1iOwe SbbPiKrPWcFamC3d5l8h8xNnK8930mIlNW3Rt+K6NdgOpTiTo6MbzcheIxSQqIM99FxO9P7cLUOdQ hF9TiC27qTzeL76lU5MX9K7RJUtpx95srdTdUjS7wv/W9u8qPhlHpcnHGu/wHaq5rdJHOj72KWImt hyUDQdYFw==; 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 1fIeTg-0006zv-4X; Tue, 15 May 2018 18:15:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 313912029F86C; Tue, 15 May 2018 20:15:10 +0200 (CEST) Date: Tue, 15 May 2018 20:15:10 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Ingo Molnar , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, will.deacon@arm.com, torvalds@linux-foundation.org, paulmck@linux.vnet.ibm.com, tglx@linutronix.de, hpa@zytor.com, linux-tip-commits@vger.kernel.org Subject: Re: [tip:locking/core] locking/atomics: Simplify the op definitions in atomic.h some more Message-ID: <20180515181510.GM12235@hirez.programming.kicks-ass.net> References: <20180505083635.622xmcvb42dw5xxh@gmail.com> <20180509073327.GE12217@hirez.programming.kicks-ass.net> <20180515083556.GA30420@gmail.com> <20180515114144.GX12217@hirez.programming.kicks-ass.net> <20180515154333.bszh4nuowhocozuc@lakrids.cambridge.arm.com> <20180515171021.GI12217@hirez.programming.kicks-ass.net> <20180515175307.m4xbkbicdrzo4qhb@lakrids.cambridge.arm.com> <20180515181136.GR12217@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180515181136.GR12217@hirez.programming.kicks-ass.net> 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 Tue, May 15, 2018 at 08:11:36PM +0200, Peter Zijlstra wrote: > On Tue, May 15, 2018 at 06:53:08PM +0100, Mark Rutland wrote: > > > > # name meta args... > > > > # > > > > # Where meta contains a string of: > > > > # * B - bool: returns bool, fully ordered > > > > # * V - void: returns void, fully ordered > > > > # * I - int: returns base type, all orderings > > > > # * R - return: returns base type, all orderings > > > > # * F - fetch: returns base type, all orderings > > > > # * T - try: returns bool, all orderings > > > > > > Little more verbose than mine, I think we can get there with X and XB > > > instead of I and T, but whatever :-) > > > > Mhmm. I found it easier to do switch-like things this way, but it works > > regardless. > > I'm a minimalist, but yeah whatever ;-) Although; by having X we only have a single I. You currently have I as meta and argument type, which is prone to confusion or something. Alternatively we could use 'p' for the argument pointer thing. > > > > # Where args contains list of type[:name], where type is: > > > > # * v - pointer to atomic base type (atomic or atomic64) > > > > # * i - base type (int or long) > > > > # * I - pointer to base type (int or long) > > > > #