From patchwork Thu Nov 9 23:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 16437 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp763416vqs; Thu, 9 Nov 2023 15:09:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+umpOtt63d3apcKI/Hu2TRcex/KUIlo47DDCRQhO7UdtdqT1eSAEz5K5bt+BSrPI9fRM8 X-Received: by 2002:aa7:88c2:0:b0:6bd:d884:df00 with SMTP id k2-20020aa788c2000000b006bdd884df00mr6315532pff.9.1699571379823; Thu, 09 Nov 2023 15:09:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699571379; cv=none; d=google.com; s=arc-20160816; b=qx0zO2O19q8fsXMUQKSa0Z29iH1iGvUfiwW+jm5Zsq6S5Pp1x/mE17wa6Erd8UbbhK SguBjGXLaY9nltWZpM+BTBn/qp7POGFy34T+HxX7vet63g6MVz04tsjGFUFbc8XQjebQ G5Lqo0sVNV82Y2kyNnRBRn55ANdCc/Kadyh8VxzsUMKMa7r7yAuuAGWWUwXu/J8bgMnV dINBf7osOtpzq5giiK2CvrdzRiAoQXKC6dEfLjpBlVgHI8t9ZLsLFa8lFahwotDoYtg8 NZWq1IFQENCJ/M9wq6SKADPZEHAFkYTlTmvprw+pAmdnoi9USJbLna4V3axok6wuZuuB OlUQ== 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=fJlrvxMcNKEZPOQgMN62udkKXdK718nD9cxru0adNmA=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=SFLn2qXuQiOm2VmnI2+6bgg7WcSYwOEh6KqziNRGa1vbBbOs/ey/IcX1xM+PfYjypR aj+Zbl+IA27DnQ1dogZoNLj0dhTmJP2NA81Xa3802lPlfjOMm6qZA1+DnXOeURoX9Hr/ kEHUyMmhCV+c0Oc/B3GiOMQfuJnj/PzvJXGbp1ynKyzJtLS1aUUrju5W+9y32ccA+SEd QcMwsmy1FeSwYlhZLtqhs8kT3gbRmREy/ClfzQKqUeE+UC6DJ2+E3r6fTAYnhx34zrWT OU5Msd0P+3X5+vpXh3k7018Db+Fv/fzDVwvJpxWVtOFBpKHKvaZ9CzyZ/dMIHt1ysnjK 87fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GhHcTBex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a35-20020a631a63000000b00563deb65f93si7916807pgm.200.2023.11.09.15.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 15:09:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GhHcTBex; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id BB71783A2352; Thu, 9 Nov 2023 15:09:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234809AbjKIXJg (ORCPT + 31 others); Thu, 9 Nov 2023 18:09:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjKIXJe (ORCPT ); Thu, 9 Nov 2023 18:09:34 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B90B24231; Thu, 9 Nov 2023 15:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699571372; x=1731107372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hnpIpGXuGDWvAQGbF6yB63hW3Mlj2/cO9Ba/c4OMGKQ=; b=GhHcTBexPFxgogUfcPgew1mGaYWeLSPKVvYZwcisSBOayRQpmPwifNq2 BpK0mLwaPsBRKhVaFFK0OenaIzhKzxOISqoG8SS1qM2ZyOkeFHU2fis+7 MEdpPYojLbIkRRjuBW4eOFJEqatWkw036pV9okhkSEbQQ2Nl+H0OK0pKZ SLYrdHmpkVg9bAx2jRf0lSqxDqYJfbq8qaeu90HDo1iIedBsDZ043pWhi IuVzdTFvVVI2qf/03Vv/kBsHaUYWYMdZ6BB8U1dLhhBktktYqretQbyh2 zxCkZqjzw2o8ooi4UyN2XF857zl6j7B/4oB72papZz7vS5WLpFFpeY7gd w==; X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="370298081" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="370298081" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 15:09:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="833984555" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="833984555" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 15:09:31 -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 v11 0/8] Add support for Sub-NUMA cluster (SNC) systems Date: Thu, 9 Nov 2023 15:09:07 -0800 Message-ID: <20231109230915.73600-1-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231031211708.37390-1-tony.luck@intel.com> References: <20231031211708.37390-1-tony.luck@intel.com> MIME-Version: 1.0 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 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 15:09:38 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772150361455667514 X-GMAIL-MSGID: 1782129759356088535 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 v10 to patches 1, 3, 4, 7. See patches for details. 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 | 23 +- 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 | 403 +++++++++++++++++----- 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, 598 insertions(+), 281 deletions(-) base-commit: 5a6a09e97199d6600d31383055f9d43fbbcbe86f Reviewed-by: Shaopeng Tan Tested-by: Shaopeng Tan