Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3627758rdh; Thu, 28 Sep 2023 18:56:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNzQ7aIR8fVu3w9dQ3ATQUXQJNm5fBnBRkdN1T+920Bno2V2o4cAM/whry8kuFTE8PlG90 X-Received: by 2002:a05:620a:10a7:b0:75b:23a0:deca with SMTP id h7-20020a05620a10a700b0075b23a0decamr2856909qkk.72.1695952617892; Thu, 28 Sep 2023 18:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695952617; cv=none; d=google.com; s=arc-20160816; b=IJN6dCCvXOLt8yzgAmvAQixIQFfQtqk/rev/0CaRNNiDr8Fe6ydjuXMoXqh6RRWQpX MNuCC8nK8Xwnbv9H2aa42gRcq6O6Cx9sKHTmpQgQ5XS67Mmsy1x0KJLe7eWGWz2Zk9Cy S7G0UpvF58vP5+qGq1vQU/Q3CSMfEUT7/yIiUfAnhyDsJKM+j7G8dv7+dtrQBAazLxgM jXM6H421ciQX413IzaGLUibbfx6nipumEDodyJ92eiycUUEncGL9XC3J+MnDRWm/xXvq 4r7gQfs7lHp00yncu6aSIKxkfxfJeo1mrTuB/J3kMu8b5q/IoVrU9ipKwRUUYoPQLc0R vBvA== 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=HraPDk8QvxR2/dDQh23fEzWT02ghmiEozGgM9KGSTwQ=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=CYLxc2O1D5qoEyCGAG+++lweIoebh43geEXipIqSYGmcn44WKcdEQZh/tnKMdySHCu Gp17V1DyEzH8i92U3E8Rraisu2ffacpinoAKR0zkjupmFwDU9BjFSkbQVnXfraUUO9oR w3vFkPHpbh+TC2PhlrMumMwdqhukMz4X5Gd6oVBwfhl4GsPN6dRCJNE1pxWuaqgHa9oq MbLF53xZeNg8LwZzrtbEhW2YAQBxbEPlbZjhb1TDzhpPdl8pLklUslaKqvJftef5d9Fm xCLhmLxGhhjR5YTtuNxfQBoqOCrXdZ5wX9yRuJJwLURKihEXH6Tcfe9ojk7twT2KeDF4 aDcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jrXQzhtD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y7-20020a636407000000b00563a0bacbb4si20439536pgb.694.2023.09.28.18.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 18:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jrXQzhtD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 50AAA801BF6C; Thu, 28 Sep 2023 12:15:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232052AbjI1TOO (ORCPT + 99 others); Thu, 28 Sep 2023 15:14:14 -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 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 12:15:16 -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 --- 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