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 AF3E1D0D794 for ; Fri, 11 Oct 2024 14:05:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 182A86B00A3; Fri, 11 Oct 2024 10:05:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 133636B00A5; Fri, 11 Oct 2024 10:05:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F16686B00A7; Fri, 11 Oct 2024 10:05:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D410A6B00A3 for ; Fri, 11 Oct 2024 10:05:26 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 52049C12FA for ; Fri, 11 Oct 2024 14:05:21 +0000 (UTC) X-FDA: 82661493768.09.777883D Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) by imf10.hostedemail.com (Postfix) with ESMTP id BDE4DC0019 for ; Fri, 11 Oct 2024 14:05:22 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm2 header.b=UI9p06EO; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="Y TyAmV/"; spf=pass (imf10.hostedemail.com: domain of arnd@arndb.de designates 103.168.172.156 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=pass (policy=none) header.from=arndb.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728655453; a=rsa-sha256; cv=none; b=bziCWuUdROjv3uSmkMGv8g8Pgj6zg7Dy7MKkgHcDl3N17G72+XRddiTl0mHqQCqRa5/OYO ftCP3zZSHSEnSNSoS/LU90TCLLD/pdC/nj+VS/eM8seXJr61tqgcKUrmD+3mWRETYTv3LB PdGg5QYTwgTunh634oUYISoUPvS1ZqU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm2 header.b=UI9p06EO; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="Y TyAmV/"; spf=pass (imf10.hostedemail.com: domain of arnd@arndb.de designates 103.168.172.156 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=pass (policy=none) header.from=arndb.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728655453; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hSrJ7sThlVYb9UYhob4RXeFtpQGrFvUF+x++504Pu/Q=; b=8oJkY2X4M+zsFXwN+9k70q693lYg3pu+9gV8rLgSMcZjbyA3ayYnTcM/6pkhlpGVTJr+JE XoNB8YkiZXdLVXyly65mvX2spbiaeEuvgjrTv7OcG+pxpqRIuz6p4nmKurobCzZ+4GXo+Q uSDntPwk9Owqtn+FSP6j+DxRnbv1JRc= Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3D10011400E7; Fri, 11 Oct 2024 10:05:23 -0400 (EDT) Received: from phl-imap-11 ([10.202.2.101]) by phl-compute-10.internal (MEProxy); Fri, 11 Oct 2024 10:05:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1728655523; x=1728741923; bh=hSrJ7sThlVYb9UYhob4RXeFtpQGrFvUF+x++504Pu/Q=; b= UI9p06EOODd0Ziey6j6Zyi6ivd8Z1a3Cw9Wj1IDPJfKhJaUrAb2hli0bQxn8vgiY wDufsTGw83vHhYYVTSIZaO4ToxP5+7sdedC8+TqdaTyhm9IWy6cuspMMd0kEGD80 0vaaMgzFSueV0khU2Z/LSkkkQsFaplgXEfYvdozI7kIDzU4AsqpP3RIlhRNt9RjK u9/cJ3eBpEfACw+vxSw7Pejh0wghjaacloVZRttPlLaeTfJg3DMXChnPRWc1/uMI CjZVDv4Eixa9b6hB8rVgBsIQqgU92IjN/T9Fi2kYxTdAxG5N2vhFGtqefVDopwAx 0PN955KQOhLVCHjhhspFaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728655523; x= 1728741923; bh=hSrJ7sThlVYb9UYhob4RXeFtpQGrFvUF+x++504Pu/Q=; b=Y TyAmV/u/xqr0O1WCXpk8mIHXdY+Wmri7KUWDUHBf9SS9J9Kwpug7hdFVPFMyiBv5 d1IxSBgBDByAzayLT6iEYU3dH7YX5n/7P2ujlnC0+/PbtCzXGar2WCiz+DzOU9Vc sOFmO/4pEj4StsVQWYbu1FdrDu6Qae+n0DNKr6XRCcyDiLjPuxEGm0rkLVx+5KcQ AsBQGipJ/sljpHjwqLquzmv4kLQBP/KmrOowcnl/0wjhvRdTrhsSuIyEtGWXNps5 1I7xAsR1lojJkovj8CbIwBZxaeQLOXKym5+CbC/JBRE9icPU0p7k1xa5ORAEGMs4 U9AVD4bBmAtRo0jvoZJ8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefkedgjedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddt necuhfhrohhmpedftehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrd guvgeqnecuggftrfgrthhtvghrnhephfdthfdvtdefhedukeetgefggffhjeeggeetfefg gfevudegudevledvkefhvdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvgdpnhgspghrtghpthhtohepuddv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehhrghnnhgvshestghmphigtghhgh drohhrghdprhgtphhtthhopehvvhhvvhhvvhesghhoohhglhgvrdgtohhmpdhrtghpthht ohepfihilhhlhiesihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehnrghthhgrnh eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqmhhmsehkvhgrtghkrdho rhhgpdhrtghpthhtoheprghnnhgrqdhmrghrihgrsehlihhnuhhtrhhonhhigidruggvpd hrtghpthhtohepshhhihhvrghmuhhrthhhhidrshhhrghsthhriheslhhinhhuthhrohhn ihigrdguvgdprhgtphhtthhopehtghhlgieslhhinhhuthhrohhnihigrdguvgdprhgtph htthhopegrkhhpmheslhhinhhugidqfhhouhhnuggrthhiohhnrdhorhhg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id E6D622220071; Fri, 11 Oct 2024 10:05:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Fri, 11 Oct 2024 14:05:00 +0000 From: "Arnd Bergmann" To: "Aleksei Vetrov" , "Nathan Chancellor" Cc: "Shivamurthy Shastri" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, "Andrew Morton" , "Vlastimil Babka" , "Matthew Wilcox" , "Johannes Weiner" , "Anna-Maria Gleixner" , "Thomas Gleixner" , llvm@lists.linux.dev Message-Id: In-Reply-To: References: <20240621111604.25330-1-shivamurthy.shastri@linutronix.de> <20241008005136.GA241099@thelio-3990X> Subject: Re: [PATCH] mm/vmstat: Fix -Wenum-enum-conversion warning in vmstat.h Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Stat-Signature: p1n7fd7mtwqgfxd68rbtcroqbd7eup5e X-Rspamd-Queue-Id: BDE4DC0019 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1728655522-445420 X-HE-Meta: U2FsdGVkX1/FrDoefdyk5LQ0cOFmVafxjD1WTTV9ir3px6O8OkVprZQrboSegutgzayRDINssrx4QyhzVeeaCGMhICuI52ZhHhZP5s5Le8yFHhq9pJvODOWTrkUjz3I+RbRPJAHyRe3R0nUlOdhb1CBwDWkSQkQNGeco+UzkaAJsTBa3tSFW0RzIvcHrAmiHrPhrgnDzBNIrV05FKnfec7FrrusZqPe6buIyWG41uO7Sbrmp/gwT5uADGejd2TwCEFFs3k4TOGdrhWtRDOV93y3Q0Nv5IB4iaqFz91qfN0v35b9gKULFB2qF87YIUAmhVgVirs+WbfmnqUJ+AqvFDqeYPm9BWXSrOJqYnjGRmChal3YzOSSCtafgbK0SjhaKO1TcHRecQtbnjWNG1w+L/p2S6LMOF0qkoRbD2RPoipmPADULyK7FvEebiK/xheoPo7Cp9uOkus1Ab+CENErcrRO+EbdMg5WOuWxwkPOThewn4napcJMh7w6gx5dRY/mjP2w5OOCyOe1rwSZ3HsA92m/wDx5gQRPNMghNhx42vghjlgx9rOUW1dkAWshbJ5xhBxHSAHVJSaAVEAPfq0et8+QSq2N6/o90/PizjhnJ/qeG7DVofVOu47g5b4sG7gFvapDVNUz+1kwh2FJSlFizP4eLxMnI8Vsxs89ihfTG43cSmqNYAQGhnz/OaWnaoIWOq46fZ0ymHyVDFvG3xm1Lw4qx8z6IaY1Ch5/KiVmrMms/BP2snymidhvsswKv79zx83m9kDjlznkhePMnvbZDBd5OOyHYllJCbK6GcaEmAE2FM1S6XVy2dVCIdNbOt3HVhdcjYX6QmTMXbuWltXtvwMgli1Svg0vV+QzDLblanYoz+uAtYuin5y1vqmtE0vjRvSt3uRq0ImXx/rIPj/KrSXRfuzRAM4g6e9RvepwNbqkpQo+IdEXRqRtEyt16WTigLaWZ6/TeQrVY0xOg761 +OTM727B TX0HlBREpy3/EGAlzVHdo3emY6REt4QRhsRX9yyVrxHd3Sz2D1Qe32PuKKIVN8bdL2yK/XPtpJ4EJvYfqK3siusskINdLkfDMW81aSDTJs+KLYErEzpZdUUvZujsnuaXaTcaZa6p4KuYEhbHt+vMN96wVqW5PZh+CK025oZFx2ZoqenlJUvlLHjiwuA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Oct 10, 2024, at 10:40, Aleksei Vetrov wrote: > On Mon, Oct 07, 2024 at 05:51:36PM -0700, Nathan Chancellor wrote: >> For what it's worth, I never really saw Matthew's comment around what >> value does this warning provide addressed. I was the one who originally >> moved it into W=1 at the request of Arnd because he felt that instances >> of this warning could be bugs and they should be audited. However, I >> have not seen many instances of this warning pop up in new code through >> 0day build reports and the ones that I have seen seem to be intentional, >> as they are using enums like integral values, such as here. If that is >> just going to result in a bunch of patches like this adding unnecessary >> casts, I think it would just be better to consider disabling this >> warning altogether or at the very least, moving it to W=2 (which is for >> warnings that are noisy but might contain bugs), since more people are >> using W=1 as their normal build configuration nowadays. > > If time has proven that this warning has never found an unintended enum > conversion, then it is worth to disable it for everyone. As you said in > the original thread ([PATCH] kbuild: Disable two Clang specific > enumeration warnings), W=2 is not run by any CI, so I would prefer to > disable it completely. > > Alternatives considered: > > * Enable -Wenum-enum-conversion only for 0day build reports through > KCFLAGS. It will eliminate noise for regular users while keeping > developers informed about new instances of this warning. > * -Wno-error=enum-enum-conversion to keep warning but don't block > compilation for CONFIG_WERROR users. > > Arnd Bergmann, what do you think? Have you found it useful after all? I'm fairly sure I saw users mix up 'dma_data_direction' with 'dma_transfer_direction' and unrelated enum-enum mixups in amdgpu. There were probably more. I think what happened is that in clang-18 and earlier, the warning option caught mistakes of passing the wrong enum to a function and a few others, but it did not catch arithmetic operations between enums, so clang-19 now produces a lot more output than older versions, and I don't think we can control those independently. Arnd