Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp107342rdh; Tue, 13 Feb 2024 10:45:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX2adIkyHNEcxVidrqtLzRjSCba9TBHmNDxts1OHOj7Yhd7ltQqVf4twBQEkOO8phRFtxFoCOzeT6F48NypuLDNfxk//UhI8yx1Ql8DSw== X-Google-Smtp-Source: AGHT+IHYKKVpL2UVq9H6IkM6loteuADI9W4XTaPndnWDIcGNTfViJ8u8NNbspKVGSRjv23HPmDN0 X-Received: by 2002:a05:6214:ca9:b0:68c:7302:8974 with SMTP id s9-20020a0562140ca900b0068c73028974mr587995qvs.30.1707849930597; Tue, 13 Feb 2024 10:45:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707849930; cv=pass; d=google.com; s=arc-20160816; b=pKRf0NqcGl1TGb89BoqQ35uqu3n7xTXlK43M5p+7/9jVC6o7sYTPAwinLN1JEGsUeQ At4jH1czpolQTZAFSGbyiXuTtRgcBfJ+vLh/57sID1KktoARkU+siznhqhcE5mAr5On5 4x1TIpGoACQUHHK7eTIl1UFdfOAxd8WankM+CRVUa8BV/ItG234hbbdJ2Fql5Px5JBdL TXFEqaEfCqvqVi0nDZ03e9ij5jY7e3cJQdGxPMa2Kh4AFrS9DeBz+9iFjOhK53GLpE30 UElYU2RDcfv5xIDtJBN9ZNIpRsuqqUU0NNkiMWbeRrNDlS10CM74FjrkEJAuuGzjY3QK 2eyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=FYL0k8ZSSa6/z6RfNHiTNqBJJVqEE+rEFz9X2dYGM2g=; fh=S0NhWQzZ1UzWAUCJLr/A0ODefeMie4xFWwnKUvkteeY=; b=WWr1FxiDKxyetmU4ia3s7FTS3uIDysk95Yudoba3PJ6MpoFtYP1NljsEfoFlPJ0aKF +tWNLBvoJJQBZXlKr9r28eknL6foUjKksEfzdIH2xpoSatJpUOv6wSnMDO87SX7xo0GN 49np/lm5eEATJdfJcxTDnkiJJmqOkC08rPLQyvEPUf8BNB+cn3E9AgWQGWcLiPjgeGye hLHjrGskVuN21ywfEf4k7dRdWOkK79g4Sz3e2BbMy6nNSNkeiNUXVTqd3hV7ZAiiYsCg j8jryOmzmkdamKPYUdPs8ZHCQw0UBmgh0gTpjH66uL01FvbbdzfLCXO/t3pwDA3HtT7C a/2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-64092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCVgAOsE5DBCL5N2lVB5pf8X1jKj5wAR4f+Ici6gySLXQjWgqcYmjlHbBh8TlwAYhFiC7nxbLgfz6YYO2kRtcJaW8IucE7Z7yfsi4/S54w== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kc4-20020a056214410400b006852904842csi3463345qvb.276.2024.02.13.10.45.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:45:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-64092-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64092-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 470AB1C23354 for ; Tue, 13 Feb 2024 18:45:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A38010A29; Tue, 13 Feb 2024 18:45:08 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B8A71F618 for ; Tue, 13 Feb 2024 18:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707849907; cv=none; b=rfsQBsAwNMu7ct4x4dFy/Fux/3NH8L0zWyGEmOGD7Jlt9/UCJrCfsWavHkXbofGM1dN/VZ77iJyLduFzW8eyFMgxetl3DgbNwEGyd36OAsV6rJvxdkxZByzqDIw0lYQl4/+quQLkPF3uCOeO9Y7s2oDposddtis8V6vfrCFkyL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707849907; c=relaxed/simple; bh=N9LgQW81xVaWBAUrrbwt8I6fqkUZ41bThuldzq3VtBk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F8vQELYdFmqkFfRm+xTKgec1C1qPqgZYFwD/WnCLC4pmvXQ+/6yL4+OfK0JbLdHYBlmHeWbgTiK+YaOsZBxk9Fuw/KzGtziKn/KSJGURrYNfNbIXwQeeSnkYIu1qXbLUWTUJKOcqgjMOqIokZ405HoipPOE98T5Yt3GoZAI3aiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 5B2F6DA7; Tue, 13 Feb 2024 10:45:46 -0800 (PST) Received: from merodach.members.linode.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ECE6F3F766; Tue, 13 Feb 2024 10:45:01 -0800 (PST) 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, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Frederic Weisbecker Subject: [PATCH v9 01/24] tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef Date: Tue, 13 Feb 2024 18:44:15 +0000 Message-Id: <20240213184438.16675-2-james.morse@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20240213184438.16675-1-james.morse@arm.com> References: <20240213184438.16675-1-james.morse@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tested-by: Shaopeng Tan Tested-by: Peter Newman Tested-by: Carl Worth # arm64 Reviewed-by: Shaopeng Tan Reviewed-by: Thomas Gleixner Acked-by: Reinette Chatre # for resctrl dependency CC: Frederic Weisbecker --- 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 716d17f31c45..0fb903838dfb 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -164,9 +164,16 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } #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