Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2064336rdb; Tue, 3 Oct 2023 09:09:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFq/s3VXNCtkLxIwo8RyOLacL8bzXpf5aB27V+32esXpT19TayIKn8MeknG2icCMET41UK7 X-Received: by 2002:a05:6a20:12c1:b0:154:e7e6:85bd with SMTP id v1-20020a056a2012c100b00154e7e685bdmr15320818pzg.20.1696349360729; Tue, 03 Oct 2023 09:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696349360; cv=none; d=google.com; s=arc-20160816; b=REcndW0cqnboYQcAL46O+OA8/IehSGQDR64LJFSPJuXfXQtl+xY2WusSf9rlCco51U Hk79zGGFFyvKkhE3OUwmBEXiCNjOGdzOCIcvtqksh1etliZ6F5seEWhgov2ydCg+v58f 0J5vLVZ0jMeMqXnUwX1BObBKo6h7QHQe+tnJDtey5VkN3CzAd4tCOF1mjCZTk/Xq8Ogj hOBI0uFxSdooJ+5mW6hbJzf1GMng78ThDWrnmnZdvCd7ORw++iyeI0pRkHmbU/cR+iBT DtITF5OlDJjtlCp4xsxoYg5oKYybG4tb1cs57M6Dc7i5Wfqauwq2e409VDRvY7VIWiOO x5DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z/Q+8D4732XVTmfeZLXj59cnJ9N0B75+dkYqQSa8G7k=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=IGsIT0tTjctpxuIEIaSVz73Dp8aFHu4/KE6fS5VKCUd6NoKUu1MCLLHts7e0ZmnYa0 vi1IgP2/ga+lAXPe7suSUkJZT0JrtX3GanNkknaTrTxs3mYAG0/rbVUVmiaZIFwtkTx6 1tJTWgillgvRrwAcZ+vCZjHxXYZN2Uv0i9ApNYAtpdieELFd42QR4Kvf7AV4Cadn+zZX 4gwxe9Ba50K4Gyilx8uSSu/cHMcQcBqIA1yU9iTARs1M0DqptPZ1ltL4UxNoNmffldoW 0vRDlb6WIzdjX/E+1dxR3IHMT40ABpl/nzAd2xGfLSAtb15uRYEu+jJjpDE0Dnd/rRzi pXOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OVZYKxI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y15-20020a056a00190f00b006896e2f30f2si1805392pfi.365.2023.10.03.09.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OVZYKxI3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2E36E8163C3C; Tue, 3 Oct 2023 09:09:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240393AbjJCQIb (ORCPT + 99 others); Tue, 3 Oct 2023 12:08:31 -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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 09:09:07 -0700 (PDT) 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