Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp979392imm; Tue, 15 May 2018 11:58:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrlTnv1VYlzau7ZwT04MjZURLO3RkZs0lwnu13Nom2dh+82DxTqsK/50Eyjl5mvSq+grW/E X-Received: by 2002:a63:724e:: with SMTP id c14-v6mr1952783pgn.188.1526410723789; Tue, 15 May 2018 11:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526410723; cv=none; d=google.com; s=arc-20160816; b=srvBcUiE2MWengJFjlJygB/Itt41tCNPe24i2kR7SpKcyJsfJvas6Xkajjit7uJvGM CBALrFKX8+DGgkYAu5TMHPG1KwhxQcmdVmAXoI5lz69N6JsTnDZUvDl9KJfjCJNI/nSE J91LhanZ4Lov56w8Pck/fb2OzIqpGzMgploTvzBgOHpnFZFwYx5Mxg5sljMpqQwD7rh9 0mQOGGqrSEZXFAl0snY2iWDFslaIvNSjc7cxm2jky/yGOeptNXZ/xtKvrZEzQKd6IMIl MWjXaiMuQTwuIjQRXDqmhEhlYxQY3AVt+vFM31F6JqoRHf8qnR3YbI9r8vL7/aINIGQO edvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=JYoXSVF45PiDS8Rq2YC/z2r7DR0Z/9PWEC0wls4bld0=; b=MMIwEkJKP2Cxogj3vRIfvrFv8zlGiJ7F9lfZagnPwMFyYgCZy9/xYBbepP8AMQtQ3F ROUv0JQkInQGqFth/NFA8lJoABC85Sb0VNIdx1S8IHLArID9WLpSuPY9BtpIRDhxU6dS XY96qexzII1G7ZWot2nPgtfxLrBsHb1dNOw9moEu5Mhweg0yJ6MxeXbChilPlqrdG1tz 63SLO5d52DlCy55YJmzeKN9RFJm7nTZ8pLqYSApgnmUlMVfsTsnGNdT3IIOycGylm1Cd /+q202Wm7Pn4xyKv8yXUp02f37tfEC2dI/bWK98Nn6BMm1SlH5GTrE7i231zC4YCPO13 aObg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=h2y3QO+K; 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 f8-v6si610300plr.471.2018.05.15.11.58.30; Tue, 15 May 2018 11:58:43 -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=pass header.i=@linux-foundation.org header.s=google header.b=h2y3QO+K; 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 S1752547AbeEOSwb (ORCPT + 99 others); Tue, 15 May 2018 14:52:31 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:33670 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751198AbeEOSw3 (ORCPT ); Tue, 15 May 2018 14:52:29 -0400 Received: by mail-it0-f45.google.com with SMTP id e185-v6so8875972ita.0; Tue, 15 May 2018 11:52:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JYoXSVF45PiDS8Rq2YC/z2r7DR0Z/9PWEC0wls4bld0=; b=h2y3QO+KsYFS1LPIjFcTX6DUCaORbidfDFRs8yP9NEKPxVWAEjZ0Mx6z+TLT5qHN8Q cmRY5U3ugkNir0jkb8VeoKUQQIVkGv7g3mccb9ZN6CNjXfjC8TOu3tmVYVb6bh6qimSL r2YbK+iya76VfjuUpkODcBgc6DnRvl+prwWGc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JYoXSVF45PiDS8Rq2YC/z2r7DR0Z/9PWEC0wls4bld0=; b=nPBifUcPpqCWYHU/SNYbnWlhkr/WID1YGr8rr6Q3KylPwMStVJQIcmhKwUsPIkXK1j gcFQ3Hm3aFo0ceIKsmFihzczx5IHGo1TWeP1fvC6lazB4AlHYhmPb999KUykwpWK0gTj EWJaX06eTPkw4J0hf8WUdA0wRY78F5tJBjJKGJXIkTFhuqnxDnERv1bQCffywSprU1p2 KY1jbSqnHbl/lXP2RjPUtIfqa0fwZDVBiw8+SkJ5yuHlc7COqXuBCYtL8lcutrGrT9eO yVeC5uFii252sIudk3gb2A/j0mk5H9pQX2HRi/FVAUJitJEuvxXScyG5zs3Nw+qAkm9u iZzA== X-Gm-Message-State: ALKqPwcu4vy3871QHKznhPWcUCYjjdHSVGngP6uQOyZyVVJzrUpWgsjA B9BrxY0hFUrCbTU+ia0rK5IUErBuRJUg8+CfkSk= X-Received: by 2002:a6b:6803:: with SMTP id d3-v6mr16822111ioc.48.1526410348266; Tue, 15 May 2018 11:52:28 -0700 (PDT) MIME-Version: 1.0 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> <20180515181510.GM12235@hirez.programming.kicks-ass.net> In-Reply-To: <20180515181510.GM12235@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Tue, 15 May 2018 11:52:17 -0700 Message-ID: Subject: Re: [tip:locking/core] locking/atomics: Simplify the op definitions in atomic.h some more To: Peter Zijlstra Cc: Mark Rutland , Ingo Molnar , Linux Kernel Mailing List , Andrew Morton , Will Deacon , Paul McKenney , Thomas Gleixner , Peter Anvin , linux-tip-commits@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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 11:15 AM Peter Zijlstra wrote: > Alternatively we could use 'p' for the argument pointer thing. Probably better than having i/I. But while people are bikeshedding the important stuff, can I please mention my personal pet peeve with generated code? If we go down this "generate header files" path, and ever expand to actually generating some of the definitions too, can we *please* try to follow three rules: (a) make the generated header file not just say "this is generated", but say exactly *what* generates it, so that when you look at it, you don't have to search for the generator? (b) if at all possible, please aim to make "git grep" find the stuff that is generated? (c) if b is not possible, then generate '#line' things in the generator so that debug information points back to the original source? That (b) in particular can be a major pain, because "git grep" will obviously only look at the _source_ files (including the script that generates thing), but not at the generated file at all. But when you see a stack trace or oops or something that mentions some function that you're not intimately familiar with, the first thing I do is basically some variation of git grep function_name or similar. Maybe it's just me, but I actually really like how fast "git grep" is with threading and everything to just go the extra mile. And what often happens with generated functions is that you can't actually find them with git grep, because the generator will generate the function names in two or more parts (ie in this case, for example, "cmpxchg_relaxed" would never show up, becuase it's the "relaxed" version of cmpxchg. So (b) will likely not work out, but at least try very hard to do (a) and (c) when (b) fails. So that when people do stack traces, if they have the debug information, at least it will point to the actual implementation in the generator. (NOTE! I realize that right now you're just talking about generating the header file itself, with only declarations, not definitions. So the above is not an issue. Yet. I'm just waiting for people to generate some of the code too, and being proactive)_. Hmm? Linus