From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04749E7AD75 for ; Tue, 3 Oct 2023 16:08:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240373AbjJCQIa (ORCPT ); Tue, 3 Oct 2023 12:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240308AbjJCQIU (ORCPT ); Tue, 3 Oct 2023 12:08:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A8A8AB; Tue, 3 Oct 2023 09:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696349297; x=1727885297; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7wXd0jyqeQpSWVkpv61+vloclR4PHomNHmE11ivT1+M=; b=OVZYKxI3YtBH37Gd4uLZeahsnm1jY2fOfoXa/YXt4xp6iurHoQvVhEqm rQ9FydiVI6fDYEFKe2G2ENVN0M0C6rwuDa5qofjYZLw0uZI+q0lsJ8dfi QX73oG9JODd3EOJTdirSjThuA7eGOE6dedAxKOLbovZM9KUHgrQd6t8p/ 2W8p64NAnEkSPuC4F69q1xvmyByFV/7ubo7jcQryxFimERUROsAXVPUKc nSJXFEOta5XSVm13WYGJYJn04JVlX0JzMF+I8J/0JDx29xLZcyE1MEmMi addivUsvNMjZSnTVEUFXCbhKQFYxzcNCgdo54LqTNKdBqaBAh5ITKu2Ko g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="447083290" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="447083290" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 09:08:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="998098105" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="998098105" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 09:08:10 -0700 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 v7 5/8] x86/resctrl: Add node-scope to the options for feature scope Date: Tue, 3 Oct 2023 09:07:56 -0700 Message-ID: <20231003160800.8601-6-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003160800.8601-1-tony.luck@intel.com> References: <20230928191350.205703-1-tony.luck@intel.com> <20231003160800.8601-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org 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. Signed-off-by: Tony Luck Reviewed-by: Peter Newman --- No changes since last version 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 56fa04cedb50..15b98ac91272 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -172,6 +172,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 d92fdce4e44f..6b937da36e4c 100644 --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -511,6 +511,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