From patchwork Tue Oct 3 16:07:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 14879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2190974vqb; Tue, 3 Oct 2023 09:08:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF20GxQOfg2ZnLl63m9LxapkVirvBfBjpsKGxjPPOpbbmWgvD/Dzb7ikE3+T+Lcxftsoumy X-Received: by 2002:a17:902:da84:b0:1c4:4a4d:cc6 with SMTP id j4-20020a170902da8400b001c44a4d0cc6mr4263642plx.19.1696349300303; Tue, 03 Oct 2023 09:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696349300; cv=none; d=google.com; s=arc-20160816; b=gce5JoptW5gxZE7tMei+a1Am3uoaLfpsnUhH9yNalY4dTY+KTuyzktQp+HE4ZQXCaC IupuOvp/fozE6CVZhuzXryjEbmklv/B3pg+FsG5pBdsHF+D9UXcmPtnACdUWxhC5ZSdl c0D4RIOtQOVu8SOlKpzFK4M3EWpEZmfOCXGt7PS497FA6qG7onlR48zPWp7wONg72s6w ZqICV7SCEoZc8PP28bEgK8JGHWiGKNxIcDwatLL12PE5czjmYAznwWobpVuMv9pVt/+R jL7A07T5O6isns5sDkNZoGNzNrnqanmLunFXRKITSguksXXlfGaDNXNq+6X7jwSbkjs4 0/wQ== 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=B+MXhkbHZv2HF4bHYzK3lQLmb75v0kjH4M6jDZujvPI=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=a/M9W2b8hVXDhgwQaXCaNLMkDLaiqtX0DA1343icIYs2hyidwr5ShVDDGOqd0oXw3C MXppRQrKTj06sUybf8GWxeCoB4Vc+SkefEPvoKgzcJ/Q/fkcS5Ic8oTJXot6W22a/sVY AwvABr5pyk6Jse50RD+fshYhSFicY+GeyRWSyG9DXDhIt59CNAzlXNHvuRx3SyFWA43a ORolA6F9PNYJsJB1BDmf87apQ2REIpSCqnTlE0OlmMAyjBtiXY0qTj4WMRO6Ur04QgiI nY8W+ISSF2q5P0CsGJalTZUCCceHwWAm96Mrg5tNRkTWYh/0FvhvSOGTSwM9agxqxMRo 8RCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JysLfR1v; 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l2-20020a170903244200b001bb0ba81053si1951384pls.50.2023.10.03.09.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:08:20 -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=JysLfR1v; 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 7DAE082CEFDA; Tue, 3 Oct 2023 09:08: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 S240245AbjJCQIS (ORCPT + 17 others); Tue, 3 Oct 2023 12:08:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235282AbjJCQIQ (ORCPT ); Tue, 3 Oct 2023 12:08:16 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 655089E; Tue, 3 Oct 2023 09:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696349293; x=1727885293; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GxY6djkdXGLXDWuW+6GGDFodlat750WRBGDESi40hYk=; b=JysLfR1vIuLvK61WxrqTk03gGQMSY5TQCHr+8awuksgt3+0rVHvQ241v jUefVYd5TP+kDV92nfb0MoCTcE9wJ3WKjbdWUXTyHQQ62+xmh+BS31My4 haO9hn9oRcFXWuxLMw04TsLwYEalRSqWQiHuzHgOfOtSSzKBzha9l8f5a elVZaFEn4atd1oPd/ViHrFdMNgrDIMnHzsaHv0xwnEs5bDiLSWiXg114U SsqpAYUnC9J8a0KgpeDYoxr+Qy4HxDntzsZItvey1ryR1rel90XlEh41t +DVIrQlTy/YgoDgD4QfYOsMlYi9xn6hIFoG5eFIYlhh6ETQgiZIqZQI9y A==; X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="447083215" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="447083215" 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:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10852"; a="998098083" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="998098083" 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:09 -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 0/8] Add support for Sub-NUMA cluster (SNC) systems Date: Tue, 3 Oct 2023 09:07:51 -0700 Message-ID: <20231003160800.8601-1-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928191350.205703-1-tony.luck@intel.com> References: <20230928191350.205703-1-tony.luck@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 09:08:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772150361455667514 X-GMAIL-MSGID: 1778751163968556162 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 for monitoring features to be used (with the caveat that memory accesses between different SNC NUMA nodes may still not be counted accuratlely. Note that this patch series improves resctrl reporting considerably on systems with SNC enabled, but there will still be some anomalies for processes accessing memory from other sub-NUMA nodes. Signed-off-by: Tony Luck 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 | 400 +++++++++++++++++----- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 58 ++-- arch/x86/kernel/cpu/resctrl/monitor.c | 58 ++-- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 14 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 132 +++---- 9 files changed, 591 insertions(+), 246 deletions(-) base-commit: 6465e260f48790807eef06b583b38ca9789b6072