Message ID | 20240213184438.16675-2-james.morse@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-64092-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp750614dyb; Tue, 13 Feb 2024 11:06:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXNlIfOZdJdkSb92bZdLgn9Pf/V5oH1qx8GKpbYit9l0+lRwiJ/0FErqIOykjsonxeg77O2e91yEHSGBskbATjC+D2cDA== X-Google-Smtp-Source: AGHT+IEf1PkeQK/WWs6nVYajHCl+V6/eCL3J79k3dZWwrHUEXs2PGRhhAD90msCaDTNmRgA4BGCJ X-Received: by 2002:a17:90a:ca85:b0:298:a446:f929 with SMTP id y5-20020a17090aca8500b00298a446f929mr3920525pjt.11.1707851206392; Tue, 13 Feb 2024 11:06:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707851206; cv=pass; d=google.com; s=arc-20160816; b=TkTJOY2MCl7P7FNjQZeluD1M+WGT71DX589SyhmTqRAF73rOI6ocEAv5g8ZCisMwIr iR1SY5SAjt3RWbplRpm+BLbgiGtZQrpSN3RW2ndQLltJ36wV2nuNZhkSCQWTBs6U6b5t MAPVKOYWnxlzSisi1RLON++Eg7FByhLDh8+1OYes5Re1SIDfrUN8LuhInm9u+RKzXhPl yNxu3EGUFe2bK7YsEealKf/AFvJI0NfjmskuPBYVAz2tmzStdg8qs+dYfp391h3LR8Gv sB64MyjoXL9Df60luWRMqos6pkB+WlSG1MBRbHmfBG29Dx/vhHPNYm/yfhVU2zQtbi3a jC1w== 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=10QB5fcqKXTOqGF87TZL/6iDK/nGLe8DOYFsQBOjjnY=; b=M+BSYujzJW0O02J2h4E9LEK/MovlEf2jOzdiljVhlpb7z0jcOPyi0qUn28SzNMqAUc BHeUJqU/ye2jwxcSt8rQqBxueG3wJ4bKN+2s3WE+FMHoQMWhWFz5APvsxV2HqY81d7Xk ZN7eZc4VNNUfY1K4W5SzUgqHj6j1AsVO/MOKHk41tMYEgKx2BuJ5ruS9UXhiqJ2SBoHq 1zWAJHpSAh9cFAQJXnZw0uowwlsROSlDuyr1kAfLde63Aoz1eLaljM9UfRqjQBw8byDL Q/CIx8dcw4fqxht+wrP2bNzoSVrp0VVSZsMrgTNmlhNJxxeLrsXVTk1Y9toNINgxfYQt K0ew==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64092-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCVpg+jyALOc9kvqCgvI8YG/hrPeMZspKIpjJrdxwzz6i6ZSlKdZKIg5MIdVHJlh1OXa4gUPTRACbrN1lOHPAppzaUet9Q== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t19-20020a639553000000b005d92a3f1196si2405298pgn.592.2024.02.13.11.06.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 11:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64092-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64092-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8BA62B239F3 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 18:45:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0239C57885; Tue, 13 Feb 2024 18:45:09 +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 <linux-kernel@vger.kernel.org>; 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 <james.morse@arm.com> To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: Fenghua Yu <fenghua.yu@intel.com>, Reinette Chatre <reinette.chatre@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, H Peter Anvin <hpa@zytor.com>, Babu Moger <Babu.Moger@amd.com>, James Morse <james.morse@arm.com>, shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS <scott@os.amperecomputing.com>, carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles <quic_jiles@quicinc.com>, Xin Hao <xhao@linux.alibaba.com>, peternewman@google.com, dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand <david@redhat.com>, Frederic Weisbecker <frederic@kernel.org> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790811786704839901 X-GMAIL-MSGID: 1790811786704839901 |
Series |
x86/resctrl: monitored closid+rmid together, separate arch/fs locking
|
|
Commit Message
James Morse
Feb. 13, 2024, 6:44 p.m. UTC
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 <james.morse@arm.com> Tested-by: Shaopeng Tan <tan.shaopeng@fujitsu.com> Tested-by: Peter Newman <peternewman@google.com> Tested-by: Carl Worth <carl@os.amperecomputing.com> # arm64 Reviewed-by: Shaopeng Tan <tan.shaopeng@fujitsu.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Reinette Chatre <reinette.chatre@intel.com> # for resctrl dependency CC: Frederic Weisbecker <frederic@kernel.org> --- 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) {