From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF916C433EF for ; Sun, 8 May 2022 20:52:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25A126B0071; Sun, 8 May 2022 16:52:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 208906B0073; Sun, 8 May 2022 16:52:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D1DF6B0074; Sun, 8 May 2022 16:52:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EF0EA6B0071 for ; Sun, 8 May 2022 16:52:03 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id C4C04120C95 for ; Sun, 8 May 2022 20:52:03 +0000 (UTC) X-FDA: 79443772926.22.457C30B Received: from relay3.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by imf12.hostedemail.com (Postfix) with ESMTP id 3FE1E40064 for ; Sun, 8 May 2022 20:51:43 +0000 (UTC) Received: from omf16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5D82630341; Sun, 8 May 2022 20:52:02 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA id 0F54C20014; Sun, 8 May 2022 20:51:55 +0000 (UTC) Message-ID: Subject: Re: [PATCH mm] tracing: incorrect gfp_t conversion From: Joe Perches To: Andrew Morton , Vasily Averin Cc: Steven Rostedt , Ingo Molnar , kernel@openvz.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Sun, 08 May 2022 13:51:55 -0700 In-Reply-To: <20220507154835.4d4d737d8eed579969f15938@linux-foundation.org> References: <331d88fe-f4f7-657c-02a2-d977f15fbff6@openvz.org> <20220507123728.f20d977eba9fbb66bddee722@linux-foundation.org> <8b1cfefa-da7d-3376-cf04-1ff77dab8170@openvz.org> <20220507154835.4d4d737d8eed579969f15938@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18Yu0PF9VUwVKahCSWHsG2R6SAcUhY02Eo= X-Rspamd-Queue-Id: 3FE1E40064 X-Stat-Signature: ph9j6s7z4epswkkz7h4tr76stc3bhaxm Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=none; spf=none (imf12.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.16) smtp.mailfrom=joe@perches.com X-HE-Tag-Orig: 1652043115-837159 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1652043103-933308 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, 2022-05-07 at 15:48 -0700, Andrew Morton wrote: > On Sun, 8 May 2022 01:28:58 +0300 Vasily Averin wrote: > > > On 5/7/22 22:37, Andrew Morton wrote: > > > On Sat, 7 May 2022 22:02:05 +0300 Vasily Averin wrote: > > > > + {(__force unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ > > > > + {(__force unsigned long)GFP_NOFS, "GFP_NOFS"}, \ > > > > > > This got all repetitive, line-wrappy and ugly :( > > > > > > What do we think of something silly like this? > > > > > --- a/include/trace/events/mmflags.h~tracing-incorrect-gfp_t-conversion-fix > > > +++ a/include/trace/events/mmflags.h > > > @@ -13,53 +13,57 @@ > > > * Thus most bits set go first. > > > */ > > > > > > +#define FUL __force unsigned long > > > + > > > #define __def_gfpflag_names \ > > > - {(__force unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ > > > - {(__force unsigned long)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \ > > ... > > > + {(FUL)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ > > > + {(FUL)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \ > > > > > > I think it's a good idea, and I regret it was your idea and not mine. > > heh > > > Should I resend my patch with these changes or would you prefer > > to keep your patch as a separate one? > > I did the below. I'll squash them together later. Very repetitive indeed. Why not use another stringifying macro? Maybe something like: #define gfpflag_string(GFP) \ {(__force unsigned long)GFP, #GFP)} #define __def_gfpflag_names \ gfp_flag_string(GFP_TRANSHUGE), \ etc...