From patchwork Fri Jan 26 22:38:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luck, Tony" X-Patchwork-Id: 192842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp190741dyb; Fri, 26 Jan 2024 14:41:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGk6NPNLHfwgQy1sPbJ3jcS0PksuUYtP9OFVb6G33Lr7cbsXOU9FdVYPmkrZ/U7UFZauj2 X-Received: by 2002:a05:6808:1889:b0:3bd:a65e:601f with SMTP id bi9-20020a056808188900b003bda65e601fmr508756oib.7.1706308869577; Fri, 26 Jan 2024 14:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706308869; cv=pass; d=google.com; s=arc-20160816; b=THROOlEIyZn7t/orSz13/3+2tvaI6qKXNPYs/HJdRqD4ZLa3teAX7gBMHypuiXJmso aZPKZ1RHy/q13YFAypT6gY+BYrjELNT4A6uTnsMJLYeExjXnrsIQ8UZAwVx5k7KbHnQh yO04EyKldZJ8lUj/ze/N1JkJ1A2nfDHH9qsSSBOq78NYnmqLbZT8tYrvd4uRv0Ywvzo0 uax1OH57A/nB8vr+hQVyHdoKYicIUPYGS9Psg0YOg6bcN7GEU0zS8vu/tgCqfOgU6ttd V62xj9lA8A3sjvAVy3tfX1TDmkupin3fm74PYWKFcqGK+TI25kgaqUJ/dX8vdsD7pdO9 1Dog== 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=+V6jLOwP+e+Kr3FLGFcFVHRrtQn5NRFf4EDfceyjDYM=; fh=HLXMJXVrjdrMO+t+ScLYZOc/r2GkIgI4c473at4vdrc=; b=HLjXI47hylahVRTZVqokSutG6t9tOjAwh1l8PzI8aBMlA/3M7fw9n03mjmppENNIYj GWOsNpe989bglpytY1drCKKxl+kjAVMsf5Z5136H9lBUJmu2kDmYsEx2AE8p8o33oWUR ZtYm4T4eB/ErYpbku6yRWZyGu7fkwx9dZItepJl9PjsoVqp3nOrwQ39LVdudfEsUdMy/ qKOIqxPIBWJhoTKjEch1aGydXWN9a+URviZRRtwilHf6Ic2r1ZBNfU/GIOBy/u1NA0Qe 654TWMBQRrSLTuMqZ9bnfLT2MDzaiXxYlb6Urh9n1UW+nf/TFeQdSzXLJEBNILuvNgMV kBTA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ShLMIj/I"; 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-40792-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kd4-20020a05622a268400b0042a8c127311si31210qtb.133.2024.01.26.14.41.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 14:41:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40792-ouuuleilei=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="ShLMIj/I"; 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-40792-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40792-ouuuleilei=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 E2BBC1C25093 for ; Fri, 26 Jan 2024 22:40:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 080A9286B7; Fri, 26 Jan 2024 22:39:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ShLMIj/I" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 08EC553E21; Fri, 26 Jan 2024 22:38:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308736; cv=none; b=E7lOPSfl3em2qLQkLRscWua5u+0/llqXsiWBUGRKZxsHItX9VB9jKQRaouGHgPufOFawu7aV/NwexwAREvYim9QTvvc4SVnYAnFFmnCtBOvJbadFwF04e3B+G6BXrIhsMV1i9DbuZimRjKAXkbxRvx282UFfvi2FSa24vvivtKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706308736; c=relaxed/simple; bh=+qqwl/QGgrcrhJ6bwo0zQQqegC4LYQZlox3muG18Qkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GCYI4FZ0aPuomqX67vn9CtFkpLsO/slELVuuwzkz7oxh3HRfJgoFv7ER42QBGYprvbxYwpppYjE3L92e6+tHS/sj1+XOXfGuOO3nlj8cSHrCFWyR9C1aldpsK/8l7qRWpvho7n1K/tZbrPQrpBNr9HXHkIvYlD2i39MRSM5E4Is= 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=ShLMIj/I; arc=none smtp.client-ip=198.175.65.13 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=1706308735; x=1737844735; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+qqwl/QGgrcrhJ6bwo0zQQqegC4LYQZlox3muG18Qkg=; b=ShLMIj/IcOhThncZTseopq8nB4U29kndK9WytHdSBB+zXunf7x7CLNF4 F0iO0y5nI8cpLygXuhI4dGA+o6WjhK2nkWVLEfl8Qv2BYeRuu8sLH+bIL vtBmV4dMxT8/vXggUtVNPaAdqdGkW1ffLukrKNX3PfJZItF9Q2fPDQD/V FwhbjlFAZGGCg1RsS1C1pAr65DDF3MVfWREV9NAbGPxKUNMdyHq5GxCJi xmm/GX3rANcEDiYKZojxTflCTyTCUQs6lE8DuhahfXEPu6bXau7Lp+TjE Krk/AGh6ww+TjGSanFpdNcoRQoJG38voE6zYgyUVEi/0f4NlKdhS6DoqC Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="9707742" X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="9707742" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 14:38:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="35560272" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 14:38:49 -0800 From: Tony Luck To: Borislav Petkov Cc: Fenghua Yu , Reinette Chatre , Peter Newman , Jonathan Corbet , Shuah Khan , Shaopeng Tan , James Morse , Jamie Iles , Babu Moger , Randy Dunlap , x86@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, patches@lists.linux.dev, Tony Luck , Shaopeng Tan , Babu Moger Subject: [PATCH v14 8/8] x86/resctrl: Update documentation with Sub-NUMA cluster changes Date: Fri, 26 Jan 2024 14:38:37 -0800 Message-ID: <20240126223837.21835-9-tony.luck@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126223837.21835-1-tony.luck@intel.com> References: <20231204185357.120501-1-tony.luck@intel.com> <20240126223837.21835-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771324085713837497 X-GMAIL-MSGID: 1789194529174062149 With Sub-NUMA Cluster mode enabled the scope of monitoring resources is per-NODE instead of per-L3 cache. Suffixes of directories with "L3" in their name refer to Sub-NUMA nodes instead of L3 cache ids. Users should be aware that SNC mode also affects the amount of L3 cache available for allocation within each SNC node. Tested-by: Shaopeng Tan Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: Babu Moger Signed-off-by: Tony Luck --- Documentation/arch/x86/resctrl.rst | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index a6279df64a9d..15f1cff6ee76 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -366,10 +366,10 @@ When control is enabled all CTRL_MON groups will also contain: When monitoring is enabled all MON groups will also contain: "mon_data": - This contains a set of files organized by L3 domain and by - RDT event. E.g. on a system with two L3 domains there will - be subdirectories "mon_L3_00" and "mon_L3_01". Each of these - directories have one file per event (e.g. "llc_occupancy", + This contains a set of files organized by L3 domain or by NUMA + node (depending on whether Sub-NUMA Cluster (SNC) mode is disabled + or enabled respectively) and by RDT event. Each of these + directories has one file per event (e.g. "llc_occupancy", "mbm_total_bytes", and "mbm_local_bytes"). In a MON group these files provide a read out of the current value of the event for all tasks in the group. In CTRL_MON groups these files provide @@ -478,6 +478,23 @@ if non-contiguous 1s value is supported. On a system with a 20-bit mask each bit represents 5% of the capacity of the cache. You could partition the cache into four equal parts with masks: 0x1f, 0x3e0, 0x7c00, 0xf8000. +Notes on Sub-NUMA Cluster mode +============================== +When SNC mode is enabled, Linux may load balance tasks between Sub-NUMA +nodes much more readily than between regular NUMA nodes since the CPUs +on Sub-NUMA nodes share the same L3 cache and the system may report +the NUMA distance between Sub-NUMA nodes with a lower value than used +for regular NUMA nodes. Users who do not bind tasks to the CPUs of a +specific Sub-NUMA node must read the "llc_occupancy", "mbm_total_bytes", +and "mbm_local_bytes" for all Sub-NUMA nodes where the tasks may execute +to get the full view of traffic for which the tasks were the source. + +The cache allocation feature still provides the same number of +bits in a mask to control allocation into the L3 cache, but each +of those ways has its capacity reduced because the cache is divided +between the SNC nodes. The values reported in the resctrl +"size" files are adjusted accordingly. + Memory bandwidth Allocation and monitoring ==========================================