Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2227942rdb; Tue, 3 Oct 2023 14:31:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDFOVQ1LOrdjWMUnT8k4kk7rlJohWYRW4MbE5LzN+LkKJ8z3nt8XXA5ZH5NSZdiGeQnBDh X-Received: by 2002:a17:902:c084:b0:1bb:b30e:4364 with SMTP id j4-20020a170902c08400b001bbb30e4364mr729139pld.39.1696368709530; Tue, 03 Oct 2023 14:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696368709; cv=none; d=google.com; s=arc-20160816; b=EPcoi8FKGINCKm3TIIf1WeqNOJiGfe6Um9aNXIrAPbpzl5bWqn+K+9KqjXMXqT2mmx UqJwDAF2R1NLN58S8djtAniYcgtovsGXT73pfzmiQdtuDLA7AbSXRkyKe3dCV2f9DTp2 8n3/wr3+LwB8aSYxD7jWl9imT8WPtEGvPWTx+l45qiXuTsPOHYK9D7WAQW0Hc2nNwniL +UfT/Q52n6uARHsgSHx5h2KBwgqY+ENUma30Gqu1TagN/Ee+8Q/qHJVmLpJ/PAhyzHni HDa4ZNT/GaoNjTXHNUeIY7L8Pc1dcjBZoRK7XybIvJt16bvxKqbqp1UrAcddn6x9UBGQ Te+g== 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=hN3z81eVKalGiLh8dA74iqGBBqn5hA9uhFh2nI8PLWI=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=yVJlFzrCa8kJSiCRNJTGcLv5dKxWfVzPRcZ8AOy+/F2IcU7XUMQ+p0xeVPDpS6lFyL ip9pWqaLJhrZTFojzRPm9RYaCZ5kBZ32oVnRhe3Ek9z7xnJ7gYGLPGCWHbHA988l/F2W BwA8gosucyNAsECvRg1HPCrw1wOr8gz5Hg4KpGF14nzuOANpbn1bn0nwbguZAaZpGspI MUJtDR/bQk4wjufcM7riHNyqRZx+6O1xlK+yBbaBrQu+5owiRdRnJCfeTC3mDEwrqC1L 4Ej//g0WazGTuw374NgvdC1b5ngaZddrgAJNHQW43kUZ6IjwnyQ26SVun1BhtuNt1icB KewA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EZQRCvqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k6-20020a170902c40600b001bbd70bdffbsi2496277plk.440.2023.10.03.14.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 14:31:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EZQRCvqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 6AE48802EAE0; Tue, 3 Oct 2023 14:31:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241275AbjJCVbJ (ORCPT + 99 others); Tue, 3 Oct 2023 17:31:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241240AbjJCVa7 (ORCPT ); Tue, 3 Oct 2023 17:30:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB1AAF; Tue, 3 Oct 2023 14:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696368657; x=1727904657; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JSM8VdI0f+hGPj3fp9HIjpyV6ZFG5pNcdINSGJ8Jp+o=; b=EZQRCvqpXGzi548A8W8/WRc6hVdlv8ZnyG3cHDWuAqyo4MG7y458oBcO 1oToHy9oQs1dmjjHaRkAd6r4/B7pC5MwwrXmGPZ+llTr/MhBGxzlfvBIJ Mm79tOtqmK7DzgYLYwOymYfiIGsC+hXjI031we1qp4ZXPdBA0Z39f96qB JdU/Lsp/BXxRjJLB9L21QD7zsde9Xpr+u2IwH/Kz0BR8T61sxMC6r+DuG NH5b8+zsQa99CtvVDZohBiOLh4mlWBgCs3P+OsReKqmgYZTIa4PV2LSuN qi/iz99YtqslNNovV46uXfCcopKpoCz8HvVK9kSkrqGyt3aV0DXjQOdnS g==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="1580430" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="1580430" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 14:30:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="924801992" X-IronPort-AV: E=Sophos;i="6.03,198,1694761200"; d="scan'208";a="924801992" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 14:30:51 -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 v8 5/8] x86/resctrl: Add node-scope to the options for feature scope Date: Tue, 3 Oct 2023 14:30:40 -0700 Message-ID: <20231003213043.13565-6-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003213043.13565-1-tony.luck@intel.com> References: <20230928191350.205703-1-tony.luck@intel.com> <20231003213043.13565-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 14:31:19 -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 --- 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; }