Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1296728rdb; Fri, 20 Oct 2023 14:32:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEk8YNl+JpTnytk/nWKDyGRfX/I4mP45wwRe3A6teu95X1EcwgAeGy0zn15N+rZlc8Vx++ X-Received: by 2002:a05:6a00:218c:b0:6bc:c242:792e with SMTP id h12-20020a056a00218c00b006bcc242792emr3301550pfi.27.1697837524961; Fri, 20 Oct 2023 14:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697837524; cv=none; d=google.com; s=arc-20160816; b=I71onr49fttUmuTMWm5L0+oFlw6pYWxsK3TcwHvAHByCGSHR25hDCClmgJxzhITp/4 yNJ9+QV+qJnbhBGYzPhdJLooy+Vdjm+8vSHIWRgNMBSEqwUaPzdpP1EOKs3vXRRP2lbH 6F2b2jpwmU2K+yPKfvNMHREmvL9xsqADgF7g/+3r8Yrg+qx8TY9ykNQPHUKbswLioQd8 xj9wGYna5NmhN+PHyWTRHasLuA6NOEy8irpWyYwejqYSxz5aucIGlQ143oVXvxA/lOj5 t9/tsRwzKF+ZmSZGXQa8MHujy1C8mVQmhDfFe+1tSTSWjjrnyBbhDLceWZSrxkJE4Rpm 1c/A== 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=Bup+vobvx0IqelSlhDVp8tcnMF4rg2i1p9iaCsBL0lU=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=igv9JiHHB15KqCH4ZDZlBO8Mlvz0ez90+1HBq5Th2q+Bw7Bc1UFTctWY2r3zKIc8Xd 7+1dNEBAhqQIwJBWsDnkhA/0LoAhGHl0zCLdykrXdEpVXzXbBPeo3MsfgrCbUJBLTiNP ORGN1F+tv3MOtufmAwIcCn/oOmWr68QwipdX9PyDxxSwpSpC3A7daL9P1OcsXgsfM0A6 vlgV/b0998mc6cQfGDiyShngN1Te16ccgpYTyz/wsEF+8ySWOWcr6LNELEjfnnxOlx4j a+t9djT4TmnGcDZf9StOF9CjyaQCmsQPwdBNWTTeYbL289YPadUQ+xPHFhuGymT/RUbj 1lkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fT7dMFV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i135-20020a636d8d000000b005b837c29d10si2684138pgc.106.2023.10.20.14.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 14:32:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fT7dMFV7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 5178880F54A7; Fri, 20 Oct 2023 14:31:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232841AbjJTVbo (ORCPT + 99 others); Fri, 20 Oct 2023 17:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230466AbjJTVbm (ORCPT ); Fri, 20 Oct 2023 17:31:42 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E12C6D73; Fri, 20 Oct 2023 14:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697837496; x=1729373496; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xNCVDrNwRTmzxZ0+yJhMv6NIK8MY44N5sibNmWvRsgQ=; b=fT7dMFV7B3VrZnbDssjHztLkKASpivPsU0Jf7DwFBCmn5uXXppYdN/oQ 6gkiEF6fWNJRIS+Yit6zm5ZspUDf7u/j6ZFKBEmOatEQaRuEBXPeNvcaU dF8UnWN+Di5tSzgAIir3PxJQldnLKLe3Ae2Ya+c9sGLMWAT6WcntJoVHq hDgrRQgjlI0zgRNQ1oZjCnqA00Us8ngsBhfyQFXP4NAwx6BX14mcAxJ+J DsLWI/ohILuVqbdwL1J+qUN/UkvRMReAKUISrGlhl0ZjE0dNZyt7ayF6K wJcAHWRe+VTvCG2cMbzjXhRKAUMRttXiembc5jf8l58t8z62RvORU0/nC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="371647075" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="371647075" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 14:31:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10869"; a="881184458" X-IronPort-AV: E=Sophos;i="6.03,239,1694761200"; d="scan'208";a="881184458" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2023 14:31:06 -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 v9 0/8] Add support for Sub-NUMA cluster (SNC) systems Date: Fri, 20 Oct 2023 14:30:52 -0700 Message-ID: <20231020213100.123598-1-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003213043.13565-1-tony.luck@intel.com> References: <20231003213043.13565-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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 20 Oct 2023 14:31:58 -0700 (PDT) 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 v6 (see individual patches for specifics): v7 - had some git format-patch disaster and one of the patches couldn't be applied. v8 - Was rushed. Somehow I booted the wrong kernel while testing and let escape a brown-paper-bag bug that crashed duing boot. Sincere apologies to all who wasted time reading this series, or trying to boot it. v9 - Tested (Really! I checked timestamps in dmesg, and all sorts of other checks to make sure I was really looking at a kernel built with these patches). Rebased to tip/master October 20th since that has several other resctrl changes staged resdy for next merge window. No significant collisions, just noise where "git am" would not automatically apply. New base is: 3300447612b2 ("Merge branch into tip/master: 'x86/tdx'") Fixed the brown-paper-bag bug from v8. Added Peter's "Reviewed-by" where offered (except on patch 3 which had the aforementioned bug). 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 | 402 +++++++++++++++++----- 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, 592 insertions(+), 247 deletions(-) base-commit: 3300447612b2adbc05cbb90e5d1cb288f19c40c6 -- 2.41.0