Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1350009rwd; Thu, 25 May 2023 11:14:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ECQLEoobwShqN024kU2YZka338fotMEJK0+PEolugDXfeLIdR0AfDU5gcZb6ASS2MSrX2 X-Received: by 2002:a17:903:27c3:b0:1ac:a02f:c9a4 with SMTP id km3-20020a17090327c300b001aca02fc9a4mr2241744plb.4.1685038497555; Thu, 25 May 2023 11:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685038497; cv=none; d=google.com; s=arc-20160816; b=V67nezY4t8D38tMs6ZpiVM5gZxBsZyXtW0TLlNQ90gv18S7pGh4pJNPmYT8QPJdoDY 6VaRU4Zn0XoJMLCwfOXaVNHRjfCWOXnenDoxCxY3D7Ys9YGeRHPZdCzgoS2TxY3OzA6H 7ukhYgJdCILLLVv04zyTsGfwLhGuJSk2qXcDMf6HQvPV0DdgBj21DmCzrVlgrNBMwaJj WGcht4HnAxyl1gbB5hSc3B++gvovzSZ3rAMY5Kn/OpxJnJDQseOoc2QNBzs/PRm8lM84 nAvrUt4tG3cKYSi/tD9TimZl68chAKtB0pmL0IxxHTWySxAQXdCRw+OlCE7Lbdz1u7yO oyzw== 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=AnaEspv7yPHxWFYxao23k8O8tDzjRIv0xbGT3Sv6WLQ=; b=afy3gbYAbIWyOTe3AgaEof9oRxG3A5KrgX59Y4XnRXMpDgxN1ybV/cOiu/XmTzxgh1 qwmIZneoJICpNE1nQOF4YwT6ZWeadhS6wQhtxwEN1gXkUpOqP6jOYu2pssieDUuQtmjl 1xsJ5pYysuGYGM/5xxGjrwpZJM/k0BPSTt6aMAK2hneUjpL2j6E3XYl84J+SVMicZJwn xzJou96gdYM6T36j0wDdpzreDYLFTqdVn+PkWVlsOlqPY7MTk/wZnEfFIL2sLAnzb6Ut TLMdMVxPD3zRUF/IZ3yPd+SKMZ9nK6A8YrK0aWVWJutTIr1DHlCu4mpLp0RerxBvMyI8 LguA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a1709027c1000b001a94429df88si1928071pll.123.2023.05.25.11.14.42; Thu, 25 May 2023 11:14:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241115AbjEYSDh (ORCPT + 99 others); Thu, 25 May 2023 14:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjEYSDQ (ORCPT ); Thu, 25 May 2023 14:03:16 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 695A9D3 for ; Thu, 25 May 2023 11:03:00 -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 5730D15BF; Thu, 25 May 2023 11:03:45 -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 8E43A3F6C4; Thu, 25 May 2023 11:02:57 -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 Subject: [PATCH v4 10/24] tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef Date: Thu, 25 May 2023 18:01:55 +0000 Message-Id: <20230525180209.19497-11-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230525180209.19497-1-james.morse@arm.com> References: <20230525180209.19497-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. 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