Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp898842rdb; Fri, 26 Jan 2024 14:40:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IEx//aZP8tSKkRlBVeFvt5xxPZ8Gt+ceEYSHGYYkQT14csxIl3SbrxaC2h1cBEXx+UGlMGw X-Received: by 2002:ac8:5805:0:b0:42a:4593:c4d6 with SMTP id g5-20020ac85805000000b0042a4593c4d6mr595973qtg.120.1706308802111; Fri, 26 Jan 2024 14:40:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706308802; cv=pass; d=google.com; s=arc-20160816; b=NnnlbkshsZqLwnAOVIxGanJHg1AGhNf5bc3X9yxA3rxsJKI6V9O0izlbEK9VS9Uu2D cUIY5fcc77t2M8sAok/T59SdwyUv6Nn5jTfgTUbW68pXi3UY9zlIF9srOVWvWRQwocCj vPsEG5t6KEgQfzAPbiK8eCT7kMKYuhCxSPCoGzyS5Ic3073VnQP2iQf5I4XJOF6mvaez /1mNIsnC5WKBngxj1qSLgvQiRQeJUpq4F53heRN+vkGfSkILOXq/oueNSFIXgQY4UUDf 9ZBV1psJjJcyM00kQfABtam56sMepScIHPMl3b2IirDSLBQrKgbQPKLTaULEgdUCf4vW Usjw== 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:dkim-signature; bh=52RfnHRltrZwgW69TjcUuF+avr5JiRz11BegIQLCDKU=; fh=CeSt/0DUxAI+IzY2bemPEXMONxc81ae/+QF2A4ki9mA=; b=XBXVjvATX+G1KghYn0+NC7QNxKN37ZJmieMdR3/LwJInmq7oNOb73o7JGVd3a7jguG W0B9cGes2ezyqmVVs+eByjYixrM0ITN8qXEj8wkSmjZkkB+lPc9UA7w5+tMlC0eAcbB8 qAk+yoVNjim/wxbEnjm5ADSUavYb1siv+qZkKNXknJxHJ7R933YCTqjkluHSLvv1mpyD mXQ8TKuEstKM1W+mrsEGyTSzslh1GJsl9nKBXzZwXpgVHFAQiacBeR6cTOXJjTyawjiB L8O1J8uBGOqI+gRH4HRp2y/7h5MKb0h/D3mW595MOtFRf4/Eo6QKtR0m3Ja0vZgF7cAr T6vA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YY1ylreC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-40790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p20-20020a05622a049400b00429986b74a3si2174562qtx.748.2024.01.26.14.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 14:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40790-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; dkim=pass header.i=@intel.com header.s=Intel header.b=YY1ylreC; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-40790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 D96F71C24D13 for ; Fri, 26 Jan 2024 22:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C838054F9E; Fri, 26 Jan 2024 22:38:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YY1ylreC" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B67B51024; Fri, 26 Jan 2024 22:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308734; cv=none; b=OEFA+8Vhab5LdMIlTk3Fbjnf14NLEjqMW3BZJCBQLt54Bt95sOh6M1dqZwm2+q1iCJsdPnl7gl+3JBgA6UJeCfBG9TtJjlhI8JCbZ5BodciUsw8frHvR/Qh/GNBz4SBUl7jp2zWtP14vX1bvwY7Fu7XpZsnArzzl8WvNdnbWXcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308734; c=relaxed/simple; bh=ejTtG9IVvU1pMsWd87GPfoDZ/SXanaRDlw9oN2DlbHc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZR26JHG4cDTPpB7VklFF4XWZcIBgGSoIJpFdKKWfFj/1gwyRNLQYyvH+2W19mhTTIUrpvaUCZ3lkgM6Y/JZmCyYx6whETYDfD7hbC7qZtDTDd/lUdNgbDBz7s1QEQKFl4ajV7iNf3sahpZB2TnnPTlLDv/I/qLeZuWoOhkmOOPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YY1ylreC; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706308733; x=1737844733; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ejTtG9IVvU1pMsWd87GPfoDZ/SXanaRDlw9oN2DlbHc=; b=YY1ylreCzIDOBPybCEpYbZ6B3+pIZul4N8Bfuk31NggHBl++SrI6J/Zo /TRvOw7eb2ZzIKb4jEvxhVY6CUgidl/D5CYTykUe+XmWmN17+LHjn9Z97 D0Hui9PwzekBa9cjb5tl3+J/KzMYV9nOHSHc/+kzBDU0JywFaQ1aDuSra ePThqjxpoqHu7cQIdqLlCRpM/d/dFS8zNeSen+pxj9Owb9ltvnm7IR03Y KKkqCjnUxGQjsElrDq8ERJmavMN+EdLwPl869EHcd3peAVohuuBdzbdoU MQ8wUOaX4vqKBQxGuxDUDw0r21yQ5UpG+pevqjs2avEBtuChpIYjXkKsn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="9707700" X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="9707700" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 14:38:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="35560260" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 14:38:48 -0800 From: Tony Luck To: Borislav Petkov Cc: Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck , Shaopeng Tan Subject: [PATCH v14 5/8] x86/resctrl: Add node-scope to the options for feature scope Date: Fri, 26 Jan 2024 14:38:34 -0800 Message-ID: <20240126223837.21835-6-tony.luck@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126223837.21835-1-tony.luck@intel.com> References: <20231204185357.120501-1-tony.luck@intel.com> <20240126223837.21835-1-tony.luck@intel.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 Currently supported resctrl features are all domain scoped the same as the scope of the L2 or L3 caches. Add RESCTRL_NODE as a new option for features that are scoped at the same granularity as NUMA nodes. This is needed for Intel's Sub-NUMA Cluster (SNC) feature where monitoring features are node scoped. Tested-by: Shaopeng Tan Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: Babu Moger Signed-off-by: Tony Luck --- include/linux/resctrl.h | 1 + arch/x86/kernel/cpu/resctrl/core.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 058a940c3239..b8a3a11b970d 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -170,6 +170,7 @@ struct resctrl_schema; enum resctrl_scope { RESCTRL_L2_CACHE = 2, RESCTRL_L3_CACHE = 3, + RESCTRL_NODE, }; /** diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c index d7c0651d337d..27523841f9fd 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -500,6 +500,8 @@ static int get_domain_id_from_scope(int cpu, enum resctrl_scope scope) case RESCTRL_L2_CACHE: case RESCTRL_L3_CACHE: return get_cpu_cacheinfo_id(cpu, scope); + case RESCTRL_NODE: + return cpu_to_node(cpu); default: break; } -- 2.43.0