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 51C61CE7B1E for ; Thu, 28 Sep 2023 19:14:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbjI1TOH (ORCPT ); Thu, 28 Sep 2023 15:14:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbjI1TOF (ORCPT ); Thu, 28 Sep 2023 15:14:05 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C17219F; Thu, 28 Sep 2023 12:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695928444; x=1727464444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SnEmTSRpqMnt7CEuYlf9Sv/kATyxfsRrWWBykdECv8A=; b=jrXQzhtDGETtVcR9ndmTJf5/XMT6vGogDdb3pwF7iEI20LitlXyGlBVB Q5FTh7TPV75TUuvrloxMmA9WfVP66JukAprqew/Qp8bGWHwz8xtjzIKtK 5pEwoGp9tcwWHbqyQSMe97fBYjS4oLGqrYbJQYexXHc+MtcgvhkGI4kZq JVbZAVIyZWYLMrqzFkxGW2ZiRdUF9+p9Fr9bvmL1XmvUFhD/nLqDRmVcU qbEqtleX/aC7EvgFQFOBYtfW6zZxrSrtS4KnZGg/mqzrT3ZwpsA5UPAY7 WO9myZksU7fsa21Q8kocooYy70/eYFZ0b7f1ns0hysVGoJOVobpLNQyjj w==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="367213934" X-IronPort-AV: E=Sophos;i="6.03,185,1694761200"; d="scan'208";a="367213934" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 12:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="779020036" X-IronPort-AV: E=Sophos;i="6.03,185,1694761200"; d="scan'208";a="779020036" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 12:14:00 -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 v6 5/8] x86/resctrl: Add node-scope to the options for feature scope Date: Thu, 28 Sep 2023 12:13:46 -0700 Message-ID: <20230928191350.205703-6-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928191350.205703-1-tony.luck@intel.com> References: <20230829234426.64421-1-tony.luck@intel.com> <20230928191350.205703-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 --- Changes since v5: Updates to commit message. 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 1c925e3db2ea..18ed787f9798 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -165,6 +165,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 726f00c01079..e61bf919ac78 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