Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp593857pxb; Tue, 15 Feb 2022 23:10:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUhw/jcHB5+gECcxwVECw779k60XKXulgcKNmcAWWFhEJjpeCTwv0X/wOZ/a7ja98ZD22T X-Received: by 2002:a63:6946:0:b0:372:cb8c:a942 with SMTP id e67-20020a636946000000b00372cb8ca942mr1197077pgc.612.1644995430983; Tue, 15 Feb 2022 23:10:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995430; cv=none; d=google.com; s=arc-20160816; b=PD8FOmmFXWYeUdAdqaUXpfUy6wjPGBzOkaPIvv0uGdmCBZYapb/YkjYEK3CuRD9Mnx LH4+iYXlC2F1WDBrId0GKCHam8CTPI39BoxmuIldi5bXQayD2A5u+JLwXqH9b/73uVX2 Q0zdr0WJYnvOAecDO4NtGD517mxFCnWoXNfudrE0qGaWhTiZ7dorEIpk01ITsUXTAwtr MLwqv86lf8YpDLDlPqE3AABAkhstq0G7fyz5+wWHD394pQFQA2X3yEFXvf8SohaMLavH Bq2S8aEyvjjRELdcrdmkpHohLhyGR8AkHYhnMJB7uuMRCqs2XsCqMWlkYv0EQKO8hYPK 37OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SpEvd9GyPZA0PUZ1DrhdX2YZWUCWNDWM9x4fmLJLdlo=; b=dRCq6cnAUGpnVvOjB2Ald7Zzt4yWfUz3bT78ONUugDDlN5B/wP1GV1P5+9wvmO2vH4 Fb6zfYqfL5Re5EJ9806Vyt+A+b4GqeRZ4bM/+hy/qE8C4MJ+irj05dtHkDTcw552dPGc srpm7fHxM3Ngg+qjKLcbDIohXglfGT155GEPVjXJ5cm7grBjqfgLm3FmFZs5/jkYOEhw LF64RIlrSGliI+wv2GT7yJfY46WmkojbT/iBitVd2AX6mBJZ5Nwpih/nngdDDMajsH7X Xxl/u63HzNDp5KtsnbYfe/37PlSrN2Wtp3FsfQrJlg7h+Bz3HoQHNal49GCUP4k7x3OI /a7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SRhqgjz4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n12si15585939pjv.20.2022.02.15.23.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:10:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SRhqgjz4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 550582E7; Tue, 15 Feb 2022 22:46:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243186AbiBOSoH (ORCPT + 99 others); Tue, 15 Feb 2022 13:44:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241980AbiBOSoE (ORCPT ); Tue, 15 Feb 2022 13:44:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE3527FF6 for ; Tue, 15 Feb 2022 10:43:54 -0800 (PST) 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 29456616C7 for ; Tue, 15 Feb 2022 18:43:54 +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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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), }; base-commit: 10a64d66e319e6ea3a19f9d2e7c4f0dee90ce6e0 -- 2.35.1