Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4057255rdb; Thu, 14 Sep 2023 10:23:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+zx3wANPhBeJI5CHRsNm8/RNiM3vhBNsJf2f6jcBr929LPL+zsqXGV1GYukcVSG1lvuEP X-Received: by 2002:a17:902:d2d1:b0:1c0:d7a8:a43e with SMTP id n17-20020a170902d2d100b001c0d7a8a43emr7706275plc.53.1694712201204; Thu, 14 Sep 2023 10:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694712201; cv=none; d=google.com; s=arc-20160816; b=kHI6IIAvsFV096OFoHKv7tjvbPnWFdVdWvJDQYgYz1t2qK6rab1YdDasoqLIhU+XrM oniH4yFGmEK0J/fsrGVto/P4HhaUDI3qwSJoYGfk6OtzZnmpZo1crK+0+cXmQciKJK+2 s8rUWFGobKtyNHXjH2wtIpcQNR9i94AwSlBPtB9aTYN9jFhV4+XBYB8/nxrLPAMb9TDI JHL9RrrJQAF3dj1rGV1Gkfgq0YgiixePU1xaKPxKUpSDczX0XTuKl0KkbqXtr8qxVBiv S8fZYlZMQ662wV3OQCrJebE6weYmSfiiFB2VR782ehL5Z9H367oMAUKk4YvWOFrRstY2 /xhw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8xu+IfVxWHiKyb2l1oCXEWRhD9ZY3yipu/S3zUXQfM8=; fh=6Nl2MjDBXofbhMXyzAhf7L7loTtEBflFxRNey74qSFc=; b=XbIwoAp8pchaEYwqn5/mH4YvX+xWcclWdVIwM40bfaGMkY8JBm+Iv10y+ioZQoEiZ0 JD8wtXn46WziYmYAvf/1wftHiU7QSjdQN5xTpun2WxdxJAocVHl8Xh2yQHNDCX1Mq4oe 17M1QuLRzaIxgb8K78Kax84CId6SumzQ7pIz2WiznyFq/RNmkbo2Xqs1vpba2ENR54wR H+LCDf+qi4p8cqZtRNnfuOtoFt9AedOntIN/jF5MMXvuoHMeidTRZ3d9zPoRGAiYab5t C59hgeaeZRXjCtt6KULc4Lcb7BdPDTqfhNBdUEwvsQSYj8rPlw6Z7ZaRXUG52xUDQg2J GJbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id kb14-20020a170903338e00b001b662f49f60si1927409plb.419.2023.09.14.10.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 10:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 2917682B4E77; Thu, 14 Sep 2023 10:22:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239008AbjINRWE (ORCPT + 99 others); Thu, 14 Sep 2023 13:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231695AbjINRWD (ORCPT ); Thu, 14 Sep 2023 13:22:03 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 362551FFB for ; Thu, 14 Sep 2023 10:21:59 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2C7821007; Thu, 14 Sep 2023 10:22:36 -0700 (PDT) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 288AC3F5A1; Thu, 14 Sep 2023 10:21:56 -0700 (PDT) From: James Morse To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , James Morse , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, xingxin.hx@openanolis.org, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com Subject: [PATCH v6 01/24] tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef Date: Thu, 14 Sep 2023 17:21:15 +0000 Message-Id: <20230914172138.11977-2-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230914172138.11977-1-james.morse@arm.com> References: <20230914172138.11977-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 14 Sep 2023 10:22:11 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email tick_nohz_full_mask lists the CPUs that are nohz_full. This is only needed when CONFIG_NO_HZ_FULL is defined. tick_nohz_full_cpu() allows a specific CPU to be tested against the mask, and evaluates to false when CONFIG_NO_HZ_FULL is not defined. The resctrl code needs to pick a CPU to run some work on, a new helper prefers housekeeping CPUs by examining the tick_nohz_full_mask. Hiding the declaration behind #ifdef CONFIG_NO_HZ_FULL forces all the users to be behind an ifdef too. Move the tick_nohz_full_mask declaration, this lets callers drop the ifdef, and guard access to tick_nohz_full_mask with IS_ENABLED() or something like tick_nohz_full_cpu(). The definition does not need to be moved as any callers should be removed at compile time unless CONFIG_NO_HZ_FULL is defined. CC: Frederic Weisbecker Reviewed-by: Shaopeng Tan Tested-by: Shaopeng Tan Tested-By: Peter Newman Signed-off-by: James Morse --- include/linux/tick.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index 9459fef5b857..65af90ca409a 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -174,9 +174,16 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } static inline void tick_nohz_idle_stop_tick_protected(void) { } #endif /* !CONFIG_NO_HZ_COMMON */ +/* + * Mask of CPUs that are nohz_full. + * + * Users should be guarded by CONFIG_NO_HZ_FULL or a tick_nohz_full_cpu() + * check. + */ +extern cpumask_var_t tick_nohz_full_mask; + #ifdef CONFIG_NO_HZ_FULL extern bool tick_nohz_full_running; -extern cpumask_var_t tick_nohz_full_mask; static inline bool tick_nohz_full_enabled(void) { -- 2.39.2