From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0198286A1 for ; Mon, 20 Jan 2025 17:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737392445; cv=none; b=I8uIEGSMc7CkWnVUfspsQetOjoRaqrPFimGvEOJLiPuMSuMNeH/LBZbNx/79BohBRlRaqOBeQHMEahyvDMs0R4SOrpj07tRBUOtLrk8VGyvc5IejgQGmHJscOiveFudUj6HVggt03w4av1VQOKj9z1hhjhWQwuCujA9sRcPXVcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737392445; c=relaxed/simple; bh=eFLeqjVTgPiAw090376SG17Z9mJFbm6/n922cRk9UCQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KVcyQJwgS3LbZvyI30MFzpbvjZ2DE4qR4k1yF40H2kXtBBWlsLZ+mBJH+VpE+6nVt16aSDCopbD7dKNLTgMn/r7t73MazFHj0kUvLQQqn4yO6w4Vn1I269Lklao6fqrsWkK7koaY3Cx2nCgsEj6hfJzA+SNja1Np7bMftzJhIhw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f6CyvXlm; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f6CyvXlm" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7b9bc648736so462636485a.1 for ; Mon, 20 Jan 2025 09:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737392442; x=1737997242; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=aeb96j0t17KQfGBwsIYcLGCn6v+WZtBjSK1nZ3wXEWM=; b=f6CyvXlmKORQ9xifTbf0ZJD1bjhTP4gliTtTg6yM3kOUpflBRLhbXsQ49uUmB0ZkEY LSSKkFMKkjOHspAjot7wybdoS7Qj3R/8ufnE1ker3HhpTHWVSnhOGnLBu22sPFVZ2kfm tVdbm0VBCvnzXVJ3Py0CsvUkGFv/qpXk4flBDTJ+zS3fWuC/nT7Beldu1WEKQJVO/MXF 38sLGX3uSc18AQcQOUNhqbA8TpXpsbVgdxnGaTHbqXACLnELMPMX6rhqAEgkKpiQT2H3 is6U2+rcXOSUYKiJiRaWo/TAL6w3N8DdKY9qzjdbli0HsyEhizCi8nVSuChT5JOHg5S3 98ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737392442; x=1737997242; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aeb96j0t17KQfGBwsIYcLGCn6v+WZtBjSK1nZ3wXEWM=; b=GaIOMOAUksInad4s/6pllDmQBKNq0DpSwL+yPC7HApShxYSzvhPPXKFRSqgNrrhS68 9JhiOCuWCa8w5z1tqbffIw0vCsH/snIAXYqyQB79DQXYfQEegAuqjoWbDQGSlcL617ZN 5NxeFqLFOAa+4M6BHSJhlSYp4WoS2ZDda+ccQR7Nz0mgGZfgrcREMlvY6B8ZijQUnjvw imPiHuIo4AaY6yHxV61KCOcz3uJ+ecTru/KG29cKa36nT5+KaV0AeXKtA7og0+oNjpZZ 7jllv+r/4tZoHNDFf7JUypD2Rd8dPDpK3G3xviq9te9ZeIb8TpMrHQw5k0tsxpt3X49r 12Cw== X-Forwarded-Encrypted: i=1; AJvYcCUU083LrsrpvVL+N8qdzLATcecQiYXLvpx+t545Aauk4lMNF2/SyjLj27xiRTqT3rwSZuFakaT/jdp/zSA=@vger.kernel.org X-Gm-Message-State: AOJu0YzufGmu5HGe/Bd7yM8vtKcX39P2rcujhiBETS4nK71z1b9mmVB6 i6Ir17AStCPodZzwq0PYQPk7M5iLyUVZqJZlYHkDyF8WNKoBEiqn X-Gm-Gg: ASbGncsyJAztQ7TYHQmn4becwlIEcKJFBcSxyIsndETcoGY0R4dTIw4HbJQpdG/K8RH 8iLj13szxByvotXS6iPoV4pUrWXpQ2djohdbv+RFaZau/X0Wo5LUUd/5ITjfchmC5KH3ZIcFT8z ureQY+ae9xoN2efi4bNvl6NO9tYtv63ivm+IiL7q5TWp8f30NdunlyJFlkEwODooFRpOSOIJQC+ RmBwcqpsyhXGDoP5ucdyJRrCuatNSKoXLbB6JS93uJ2f/efNYqAxD2FXCyrq3R8bnarrEa+r/RG SkWznqSePi0s35/FFQFE0irsjH0siFoBoVWU9mdObSJTFEm72946hf9i+Db/ X-Google-Smtp-Source: AGHT+IGf4AI7JaLK7TNosM6inktWGSB/kmQMPZG3r0ageFq9tjJOTReQMLnEMWDU9BAuX13fc98aww== X-Received: by 2002:a05:620a:29c4:b0:7b6:dd7a:9716 with SMTP id af79cd13be357-7be631e5237mr2069398585a.10.1737392442457; Mon, 20 Jan 2025 09:00:42 -0800 (PST) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7be61480ff5sm461455685a.47.2025.01.20.09.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 09:00:41 -0800 (PST) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 3F6241200078; Mon, 20 Jan 2025 12:00:41 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 20 Jan 2025 12:00:41 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeiledgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomhepuehoqhhunhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrd gtohhmqeenucggtffrrghtthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleei vedtgeeuhfegueevieduffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmh grihhlrdgtohhmsehfihigmhgvrdhnrghmvgdpnhgspghrtghpthhtohepudefpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehmihhnghhosehkvghrnhgvlhdrohhrghdprh gtphhtthhopegrnhgurhhihidrshhhvghvtghhvghnkhhosehlihhnuhigrdhinhhtvghl rdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvg hlrdhorhhgpdhrtghpthhtoheplhhlvhhmsehlihhsthhsrdhlihhnuhigrdguvghvpdhr tghpthhtohepphgvthgvrhiisehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepmh hinhhgohesrhgvughhrghtrdgtohhmpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdr ohhrghdprhgtphhtthhopehlohhnghhmrghnsehrvgguhhgrthdrtghomhdprhgtphhtth hopehnrghthhgrnheskhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 20 Jan 2025 12:00:40 -0500 (EST) Date: Mon, 20 Jan 2025 09:00:23 -0800 From: Boqun Feng To: Ingo Molnar Cc: Andy Shevchenko , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Subject: Re: [PATCH v1 1/1] lockdep: Mark chain_hlock_class_idx() with __maybe_unused Message-ID: References: <20241209170810.1485183-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jan 20, 2025 at 09:11:09AM +0100, Ingo Molnar wrote: > > * Boqun Feng wrote: > > > On Sun, Dec 15, 2024 at 11:21:36PM +0200, Andy Shevchenko wrote: > > > On Sun, Dec 15, 2024 at 11:55:08AM -0800, Boqun Feng wrote: > > > > On Mon, Dec 09, 2024 at 07:08:10PM +0200, Andy Shevchenko wrote: > > > > > When chain_hlock_class_idx() is unused, it prevents kernel builds with clang, > > > > > `make W=1` and CONFIG_WERROR=y: > > > > > > > > > > kernel/locking/lockdep.c:435:28: error: unused function 'chain_hlock_class_idx' [-Werror,-Wunused-function] > > > > > > > > > > Fix this by marking it with __maybe_unused. > > > > > > > > > > See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static > > > > > inline functions for W=1 build"). > > > > > > > > > > Signed-off-by: Andy Shevchenko > > > > > > > > This looks fine to me, so I'm going to queue it, but could you do me > > > > favor if you could share the exact configs that would make > > > > chain_hlock_class_idx() an unused fuction in kernel/locking/lockdep.c ? > > > > > > I might harvest this when I come from vacations (some around mid-January). > > > > > > > After some investigation myself, it turns out that > > chain_hlock_class_idx() is defined outside "#ifdef CONFIG_PROVING_LOCK", > > but only used under CONFIG_PROVING_LOCK=y, hence the unused warning. > > > > TBH, I feel we should really clean-up/consolidate those "#ifdef" to make > > internal definition/usage more clear. But nothing blocks this patch, it > > fixes a real issue, I will add the CONFIG_PROVING_LOCK part in the > > commit log. Thanks! > > So now that we have: > > 343060092585 lockdep: Move lockdep_assert_locked() under #ifdef CONFIG_PROVE_LOCKING > > Do we really need: > > 8148fa2e022b lockdep: Mark chain_hlock_class_idx() with __maybe_unused > > As it would hide the problem fixed by 343060092585? > These two commits fix different functions, so they are both needed. Though, we could probably regroup the functions into one big #ifdef block so that we won't need the __maybe_unused annotations. I will take a look. Regards, Boqun > __maybe_unused annotations are almost always canaries of something > messy being hidden. > > Thanks, > > Ingo