From patchwork Tue Feb 15 18:43:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12747499 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 2FFD0C433FE for ; Tue, 15 Feb 2022 18:43:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87FA66B0078; Tue, 15 Feb 2022 13:43:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 82F166B007B; Tue, 15 Feb 2022 13:43:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F6EC6B007D; Tue, 15 Feb 2022 13:43:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 5D2806B0078 for ; Tue, 15 Feb 2022 13:43:55 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 24890181AC9C6 for ; Tue, 15 Feb 2022 18:43:55 +0000 (UTC) X-FDA: 79145888430.16.3BC3CE6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id A2845180007 for ; Tue, 15 Feb 2022 18:43:54 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C06FB616BC; Tue, 15 Feb 2022 18:43:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C250FC340EC; Tue, 15 Feb 2022 18:43:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644950633; bh=jVE2UPwQbGumrX229wqA975K+AttmZ9p0pF/nvpok9Y=; h=From:To:Cc:Subject:Date:From; b=SRhqgjz47Z9NvbRe3aKfoY+SUjDETfnk4XZJxkkyoh9YYzrgdktOTgRbgfT75inLW Pasx0y++4oWIo5MUdNNH+FbuGbMAFsdDLPHxo+sfO1H2RjX9LQKa4dRZusD6SRDEhq I7xfG4nUoW/Lq2Ge5F08+EwLr6unbd6cFofQ+Lh2o7Aywm0a7JZEdgX84npyygGkTN M3jTDum3/wUjb9BQIGg9EO4TD+io7PxDGaDAmFkTMdjngJjPslzVdfVebCjCD0ytyr ljQ2Q9/cymblwFUceu7qvDG8YxyD2s4XnitPHG5M5d/+/ACa2Fa20hD1ylmRp7VLUf y1LrBtwqrKcoQ== From: Nathan Chancellor To: Andrew Morton Cc: Sebastian Andrzej Siewior , Peter Zijlstra , Nick Desaulniers , linux-mm@kvack.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , "kernelci.org bot" Subject: [PATCH] mm/page_alloc: Mark pagesets as __maybe_unused Date: Tue, 15 Feb 2022 11:43:22 -0700 Message-Id: <20220215184322.440969-1-nathan@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: A2845180007 X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SRhqgjz4; spf=pass (imf24.hostedemail.com: domain of nathan@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=nathan@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Stat-Signature: rcbyn86un38t5dfnwchonhwng3otokxy X-Rspamd-Server: rspam11 X-HE-Tag: 1644950634-906193 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: Commit 9983a9d577db ("locking/local_lock: Make the empty local_lock_*() function a macro.") in the -tip tree converted the local_lock_*() functions into macros, which causes a warning with clang with CONFIG_PREEMPT_RT=n + CONFIG_DEBUG_LOCK_ALLOC=n: mm/page_alloc.c:131:40: error: variable 'pagesets' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static DEFINE_PER_CPU(struct pagesets, pagesets) = { ^ 1 error generated. Prior to that change, clang was not able to tell that pagesets was unused in this configuration because it does not perform cross function analysis in the frontend. After that change, it sees that the macros just do a typecheck on the lock member of pagesets, which is evaluated at compile time (so the variable is technically "used"), meaning the variable is not needed in the final assembly, as the warning states. Mark the variable as __maybe_unused to make it clear to clang that this is expected in this configuration so there is no more warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1593 Reported-by: "kernelci.org bot" Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 10a64d66e319e6ea3a19f9d2e7c4f0dee90ce6e0 diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7ff1efc84205..406f5d0c610f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -128,7 +128,7 @@ static DEFINE_MUTEX(pcp_batch_high_lock); struct pagesets { local_lock_t lock; }; -static DEFINE_PER_CPU(struct pagesets, pagesets) = { +static DEFINE_PER_CPU(struct pagesets, pagesets) __maybe_unused = { .lock = INIT_LOCAL_LOCK(lock), };