Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp48739rbe; Wed, 28 Feb 2024 11:37:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUL8Pn2M6lRPBVrQCFhHYBU+Dk/4/CM6HyXdv769NHtRfuPlRSSe09thI/WTISdTV6vgVFHcV2SlRvhlv5goTiwNFJ+JkEXe/fzGk+XkQ== X-Google-Smtp-Source: AGHT+IHNeYQ0h/xQIrRZExD6U/GMi2WrNiBOmh04XM7DYDsPiWQFKjAl5rxE4u/YecHhpxMgEL6o X-Received: by 2002:a05:6871:a10f:b0:21e:5a2b:58ac with SMTP id vs15-20020a056871a10f00b0021e5a2b58acmr785996oab.15.1709149076284; Wed, 28 Feb 2024 11:37:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709149076; cv=pass; d=google.com; s=arc-20160816; b=o96FI0Xsk4pmogpDLxGU2bMrZeBigSV2RwI558PsJyOYFAF0U8xE6/3thiNGU+GnqV IPUQ/yS4TjWfcX9olhN8MGXc4DVrG7l6aAxsiKHg1Zx99kRqTAsDsav7UQ85J0aoNr7u ISOMgY34AGGf2KuMOwpm78FTtCpKHLPi5bb9DoQN2Ufq6tQ5JlW/x5Oc8/SHnUcgGGnU SI70wCpQf8lQcAlhmpL2XKEN22LvFbCGkhK3avB8kiKfLnSuiJ1Zc6Iwv+/I1w/Johj9 0n+TntdUAHnQvhgldwXDPfUghBs50uqqd3SNp+wa6FckueLGzRO9xD8wp2kfN8S4ODah qaMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/sCoLoDm3ArfwoN4xS33VKUtT3oHWQN2/cjm09/l3uI=; fh=kDu4WSgSKQjfqS0+uR7gDD47kd+EMQAW47hbuuOMwvI=; b=oVytuSEo2PdkUoTLVIRSgXeJ2z0fOdeR0M0AONavgbxghJjaU68La6yhG56K/srNSo aivzB3147Todfp+z/PhFnBI0r2RSbuvWD7rRgveRSwBgZLwsEnG6Lhv/Ls0cGsh5ypFt A+EFYob9zDBomIBQQdREUzVi/pP6fM8i3IYniN8146hhmzwGxxfEFcEtn/sRF+lgk8kH 4RtBakl1u9G82j3OsBBRmOsKYi+Tgg3zfXSQ+OymyiDYxDsXLdabimq1X7Bg6sicfB4w JiNCtu3wyoZ/W1+rVzZCjiYkn8XChXDW9vFQU41jAslIGcE+1mDzfg9LPwndTFpRTrQD n98w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UxvFWK4X; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u9-20020a05620a120900b00787da37003dsi187320qkj.435.2024.02.28.11.37.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 11:37:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UxvFWK4X; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DA6011C241C5 for ; Wed, 28 Feb 2024 19:37:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49D4574431; Wed, 28 Feb 2024 19:37:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UxvFWK4X" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C91515D5CC; Wed, 28 Feb 2024 19:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709149042; cv=none; b=keJwmy7OTjeVZsAtj71ag6s/BBSiNPRc9JCLy/RK6kaX7XLXb6G24B8yLYkpIjf2h0mxIJi0L5g1FHoGdR0ZxQxgUBpGg4ELgSudu66FsoCMX+Ik+G1++G3NY4hCFMajf09/0O+6pUaZwyzZ8+38Rsr1FqzOHFjo57iE581RilQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709149042; c=relaxed/simple; bh=CCNsGpyPB60rmAZbLn5fA0IiWeGHXWTCmie41OkzAKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XDJvtVcgWOBMZln3ISzzN0rW85gPQdqUAyHGQRiFaC9GlEkEz2w6qMI76G4Alpl33PoVmlmkwu2dXnc7KIsoO/VPBEMIUPXORGdKjhqcZQmnfhhn/WInujTxk0u+CvC0c/OYNrLiTJ5JwpaGIEM+ImxKZklGE3pnfa2SUnR10kQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UxvFWK4X; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709149041; x=1740685041; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CCNsGpyPB60rmAZbLn5fA0IiWeGHXWTCmie41OkzAKU=; b=UxvFWK4XgBNMIVpYWTOol1rSTFFROCcXE1zCU2EL228ja6QoEEJvBTfT hVAeih+3LbaUtBC2VcyqPP9AZhx19VDcLZau7h5Xs7gVJcHtihSwQccVx eHdzYSoFjbKRDdUbnyJ/6H+Qt/1F+Hu2K2LVg7x0Hrw/BR+qGTzk/Txnu bkuJ6nOugzzP0+QvSMV5YHuRjDyy4LMtNtLkZIX1N/7QvgjKjN9tve6TT 5smW1dYipBPsyYQrULUkU+2y6IAK8e09S4NfdneCSYpDIeo4svKrJ+GyK c5TZ2xPbhsfePl41c3QHg8b+9cOozUaaya4OKAH7ZH3DmR3Cp5JfLpHdk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3495491" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="3495491" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 11:37:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="7485376" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 11:37:18 -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 , Drew Fustini , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v15 0/8] Add support for Sub-NUMA cluster (SNC) systems Date: Wed, 28 Feb 2024 11:36:55 -0800 Message-ID: <20240228112935.8087-tony.luck@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240228112215.8044-tony.luck@intel.com> References: <20240228112215.8044-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 v14: https://lore.kernel.org/all/20240126223837.21835-1-tony.luck@intel.com/ 1) Rebase to TIP x86/cache + my 2-patch cleanup 2) Dropped all Reviewed/Tested tags (enough changed in TIP that this needs looking at, and testing, again). 3) Added ATOM_CRESTMONT_X (Sierra Forest) to list of SNC supporting CPUs. 4) Added a console "INFO" message when SNC detected: pr_info("Sub-NUMA cluster detected with %d nodes per L3 cache\n", ret); Note that my alternate approach posted as v15-RFC https://lore.kernel.org/all/20240130222034.37181-1-tony.luck@intel.com/ has been abandoned. I'd still like to explore splitting the L3 rdt_resource into separate control/monitor elements, but that can wait for another series of patches. 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 | 67 ++-- arch/x86/kernel/cpu/resctrl/core.c | 428 ++++++++++++++++++---- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 56 +-- arch/x86/kernel/cpu/resctrl/monitor.c | 70 ++-- arch/x86/kernel/cpu/resctrl/pseudo_lock.c | 26 +- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 156 ++++---- 9 files changed, 642 insertions(+), 272 deletions(-) -- 2.43.0