Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4963247rdh; Wed, 29 Nov 2023 16:34:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFFJRa/XOjMsd1ue/s/+EJHddYAU1bLlvA6/daDcVmvWq48I0xTihK8AfN/128KI+2MuXJ/ X-Received: by 2002:a17:90b:4a03:b0:286:2e6e:b886 with SMTP id kk3-20020a17090b4a0300b002862e6eb886mr2435577pjb.17.1701304483115; Wed, 29 Nov 2023 16:34:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701304483; cv=none; d=google.com; s=arc-20160816; b=quYfjGYLSyMp0ujJ1guwVsnODsGnkkjCtPvPHC3xo0sY/3nCmvnxVB/KkgQg/hyyii YeTAaLqSAhODG1neeLUfBoyq1GeBnEiaXcrxQSStYaextsupwVCa3HWzIg419AFVLWnZ ABfV384FRpHv5gDbyviSUm4hSJTGldy/CXujQFbgWDH48U6d25MRzInPCsXeu4Hr4Gw9 RSEhjdz+lErA4ZumkzI1JnYD912vj3XbkCG2DsQUN2vRnMXoT9k68ztk+BZV0K6mr7QO 7++6aG9BeYlr8VwyqFI3InRH+jEsbgqYzSdsMj8gxOUAUgcmN88VBvK3CFyUSLZntoX3 CYdg== 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=Sbh5EFsylDbrjUs6LuzR0k2hyx5gemIlbAava6DkOvo=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=H4A5wOoOfK65v7cnsf9cpzmETWGr8U40nyMPzNWnSmvyq0kzWbXSQY7ubvp49Mnet3 zFXuAqe3Z1LK6ymZlyPa/8QJpQb3LZdQtvVc8bhILN7N/DhMxMtz+X9GrCF+KE1BnjyF L65H08LKXmuo3bfP7pksatkLwliOomOF1kLCgIwiNJZ4N0FjGn/bJHzcpbSCsGb4/TH4 RbMTtMkaj9gr6OoqcNoAr78td177J61JrgWpKNvFpk4ytn1R9giNjYLRkHPl27UJ8qE3 XZ9hNNOrUC1fOIhEiNP91wsuSglM7xX7vdeCveUTRf2h6b2O+mn8uk1Wwo7h9GhgBha6 Eaqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RMAKgOuZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id az5-20020a170902a58500b001d002bce0f8si3848950plb.0.2023.11.29.16.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:34:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RMAKgOuZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 6501480873D8; Wed, 29 Nov 2023 16:34:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231597AbjK3AeV (ORCPT + 99 others); Wed, 29 Nov 2023 19:34:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjK3AeU (ORCPT ); Wed, 29 Nov 2023 19:34:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 212DABF; Wed, 29 Nov 2023 16:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701304466; x=1732840466; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t1wNRfyKVn+hdnCko9yKkK+HNhlf1f/vbMudAv6pV6Q=; b=RMAKgOuZeFaoVcgBPuWa/F8OdRE2HCeWSQQ9M9fyEVzsZh0pdSFa3bq3 IjRlgl1UiDugTGhKAAvDGjCB9kJpbfNRefr3HNsa9cdI0tdJZ8p1Hozb4 Ujh7LJSboJ4qTPI+gLqTKHknoQqPaxcnn6KWvNKwo8El4HYaLSa7gTsaq fXOIU8m8qml5TdXCvH3F6hSMKnLnR4azxRVNFwI2bphHFlUerP/wYZMAN W7iJiPwvorrIESVeyAT3MD+xuUgSg6h4adI+KU09KbCO6yqMU3BNXtOND ffGEOTl5e6qMaIR7abRuA91cbI1bg481fjrRtzYQP17UPdzIGushDn3KS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="392990588" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="392990588" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 16:34:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10909"; a="762499565" X-IronPort-AV: E=Sophos;i="6.04,237,1695711600"; d="scan'208";a="762499565" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2023 16:34:25 -0800 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 v12 0/8] Add support for Sub-NUMA cluster (SNC) systems Date: Wed, 29 Nov 2023 16:34:10 -0800 Message-ID: <20231130003418.89964-1-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231109230915.73600-1-tony.luck@intel.com> References: <20231109230915.73600-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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 16:34:37 -0800 (PST) The Sub-NUMA cluster feature on some Intel processors partitions the CPUs that share an L3 cache into two or more sets. This plays havoc with the Resource Director Technology (RDT) monitoring features. Prior to this patch Intel has advised that SNC and RDT are incompatible. Some of these CPU support an MSR that can partition the RMID counters in the same way. This allows monitoring features to be used. With the caveat that users must be aware that Linux may migrate tasks more frequently between SNC nodes than between "regular" NUMA nodes, so reading counters from all SNC nodes may be needed to get a complete picture of activity for tasks. Cache and memory bandwidth allocation features continue to operate at the scope of the L3 cache. Signed-off-by: Tony Luck Changes since v11: Global: (comment from Reinette) Reorder tags with Signed-off-by: first, then Reviewed/Tested Patch1: (comment from Reinette) Add error message to domain_remove_cpu() [matching the one in domain_add_cpu()] for the case where get_cpu_cacheinfo_id() failed to find a cache ID for the current CPU. Patch3: (comment from Reinette) When splitting the domain_add_cpu() and domain_remove_cpu() functions add "control" and "monitor" to the warning messages. Fix the: pr_warn("Couldn't find control scope id=%d for CPU %d\n", id, cpu); message: s/Couldn't/Can't/ s/control scope/control domain with/ Add resource name. Ditto for similar monitor message. Patch6: (comment from Reinette) Used Reinette's rewrite into imperative mood for latter part of commit message. Patch8: (comment from Randy) s/have/has/ s/cache. But/cache, but/ Added Reinette's "Reviewed-by:" to all patches except patch 3. Added Shaopeng Tan's Reviewed and Tested to all patches. Rebased to v6.7-rc3 Tony Luck (8): x86/resctrl: Prepare for new domain scope x86/resctrl: Prepare to split rdt_domain structure x86/resctrl: Prepare for different scope for control/monitor operations x86/resctrl: Split the rdt_domain and rdt_hw_domain structures x86/resctrl: Add node-scope to the options for feature scope x86/resctrl: Introduce snc_nodes_per_l3_cache x86/resctrl: Sub NUMA Cluster detection and enable x86/resctrl: Update documentation with Sub-NUMA cluster changes Documentation/arch/x86/resctrl.rst | 25 +- include/linux/resctrl.h | 85 +++-- arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/resctrl/internal.h | 66 ++-- arch/x86/kernel/cpu/resctrl/core.c | 411 +++++++++++++++++----- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 58 +-- arch/x86/kernel/cpu/resctrl/monitor.c | 68 ++-- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 26 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 149 ++++---- 9 files changed, 607 insertions(+), 282 deletions(-) base-commit: 2cc14f52aeb78ce3f29677c2de1f06c0e91471ab -- 2.41.0