From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 99E8F38DEB for ; Thu, 9 Nov 2023 23:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Sg6W8Ot3" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC0BA449E; Thu, 9 Nov 2023 15:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699571374; x=1731107374; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EBKoTAhO7i9aqmllGkQFUqLANqH0yhQbjIfC4/Fqjaw=; b=Sg6W8Ot3muek1jQw0yYd1/yLMQjQJHuY+TWnjuhgXAd7chNS2hkyuHTt RWqF8GVNDxFrNhIrfLKofHYwbui/zPmFsJtwuj5N8XN8NgE7nqqWK1aZs EEvNTF+uwtwzni5DbcHxk/XGUjwHahpKv2NJqZw/wJ4NzjfiTTK1uAPbM VK7DHBSjs16DtxtZO1rVGtM8VrRIGkYl0zMwlySIBM6r6gR0oo7PBiSzP co/4CQXHvQXiROFiizYKXZFzUkQlAAhcgCaZIwywiBMaa/n5Pan8C0Er8 A+TZ/wBe0Z8jRlNBK6EPom18nUtiGjzpYWqZF2ypm3NBCCYDTwJkMwTy4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="370298146" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="370298146" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 15:09:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="833984571" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="833984571" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 15:09:32 -0800 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , x86@kernel.org Cc: Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v11 5/8] x86/resctrl: Add node-scope to the options for feature scope Date: Thu, 9 Nov 2023 15:09:12 -0800 Message-ID: <20231109230915.73600-6-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231109230915.73600-1-tony.luck@intel.com> References: <20231031211708.37390-1-tony.luck@intel.com> <20231109230915.73600-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-doc@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. Reviewed-by: Peter Newman 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 cee8b87566fa..0f2b5ee429b0 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -502,6 +502,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.41.0