Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3522810rdh; Thu, 28 Sep 2023 14:26:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEC6DYbxNvgqfGKcwoQqdp5bYQKKMnrqGQwqybyu/jWgtkqB5WTwavnpB+K745gxgCIM0Vj X-Received: by 2002:a05:6a00:2e84:b0:68e:36b1:3d7f with SMTP id fd4-20020a056a002e8400b0068e36b13d7fmr2733728pfb.18.1695936407900; Thu, 28 Sep 2023 14:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695936407; cv=none; d=google.com; s=arc-20160816; b=rJMZQPRWH+yRPY8gskW6pHBAGKXa6y9Paa//YJwyAo6XOEkDsHZFg3uSRULjUALzu1 LqqtMYh1RFKIwaoJq7Xdlr21EUC3EUwgL/nVT0EFPTKLgc3SGphL7W0bYGwKxigfuSoQ iWMt96SR17EQUAwbZN5cONR8chzrS0m5/+9+zzxOMirL6Y8WA+pozmDVZCZGoe77I4iz 7nOzSp6fkZAaoe23vmm4RGPKZQYxE6Xq2JQBgjHxo07WqL63nhdxPtGJesCLoiGwAChM pXd7WcDwD/9GHla/0dwmbj2V0F+rYKyJk9VlWTJL3fEpz743NpLwcK6tXyv+K+oYFivX JzTg== 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=dx8iYwX2a4X6jvPnb6Ok97RVw0dhMf2oUchou/zOuHY=; fh=EIH9XAmicvPIUSP7TBeBhZ/WaoqG49JQ3xV1i3Gl7Co=; b=xmUQOjVxQrWUVLRlZNWPvaSkp72rBcow3Eq1dpIwAPXsf0LLAGaAgRlC8sG9Qxil2y i4hqgZhbr2oQovcQ5SMYzPwraIXuAquJynnnKsNzPlGIKhM1KcqR5/5sOQqLnxKAO175 8h1OJac+Z16+yc5v6AerFr4dc4O3F61oZxzTRgwFQ87PwbGdrc49PZryAKLNHaaDCGrD znLGFlwMg+eUqp/D7wOYULMV4A+U1fW81MveZyg6Wk0QuDuCHwye/xJ+yX5bBUE9C0FA gkJlr7TgMn6NrNHMoi62ZZo1MObyCvd1O+v1RTN7R9L4sFrXsiOHqDxt2hx0GLWpz2+A nVEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=duWY74iP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id ei21-20020a056a0080d500b0065b4e2b52c5si18187759pfb.196.2023.09.28.14.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 14:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=duWY74iP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 F219984EBE1D; Thu, 28 Sep 2023 12:14:38 -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 S232298AbjI1TO0 (ORCPT + 99 others); Thu, 28 Sep 2023 15:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232178AbjI1TON (ORCPT ); Thu, 28 Sep 2023 15:14:13 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5DD31AB; Thu, 28 Sep 2023 12:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695928446; x=1727464446; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mn6nYHQ+REP1+buEIYzgvASYIMVA5gLIDjoJUxkB0Ok=; b=duWY74iPCS0aoa5n5Gjw2tawpKPLUFeu/NI0PYnZv6O8k4rxd0uWWOX/ PK7cKYgAWHc0XCTkgg/J4D0ezok4af01egNJRsDdcCUxNf/MJbWBJ3MyP afgLnuek101P3i38jS9+D+a8XCFtxLIsPCczd6HFrzMkw9+7kUbfZZH0L ZQQB6jq0b8CwfAR1RjeyHNKewWZfLdT4ezf1FOuKCbZUTps6k8gTLeaNi s5fVOX9eJb4qN87kpYXHrL1pWYExBeSH6rnaR7KxyuOT+ieJ8DMbSLWX8 8X8n/hQLkF6FlRRhEWZuZ3PJjqwt4dJyGVlDtX7jm3EqE3CA3ACBYA3VY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="367213958" X-IronPort-AV: E=Sophos;i="6.03,185,1694761200"; d="scan'208";a="367213958" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 12:14:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="779020047" X-IronPort-AV: E=Sophos;i="6.03,185,1694761200"; d="scan'208";a="779020047" Received: from agluck-desk3.sc.intel.com ([172.25.222.74]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 12:14:01 -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 v6 8/8] x86/resctrl: Update documentation with Sub-NUMA cluster changes Date: Thu, 28 Sep 2023 12:13:49 -0700 Message-ID: <20230928191350.205703-9-tony.luck@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928191350.205703-1-tony.luck@intel.com> References: <20230829234426.64421-1-tony.luck@intel.com> <20230928191350.205703-1-tony.luck@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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]); Thu, 28 Sep 2023 12:14:39 -0700 (PDT) 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. Signed-off-by: Tony Luck --- Changes since v5: Added addtional details about challenges tracking tasks when SNC mode is enabled. --- Documentation/arch/x86/resctrl.rst | 34 +++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst index cb05d90111b4..d6b6a4cfd967 100644 --- a/Documentation/arch/x86/resctrl.rst +++ b/Documentation/arch/x86/resctrl.rst @@ -345,9 +345,15 @@ 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 + 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. E.g. on a system with + SNC mode disabled with two L3 domains there will be subdirectories + "mon_L3_00" and "mon_L3_01". The numerical suffix refers to the + L3 cache id. With SNC enabled the directory names are the same, + but the numerical suffix refers to the node id. + Mappings from node ids to CPUs are available in the + /sys/devices/system/node/node*/cpulist files. Each of these directories have 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 @@ -452,6 +458,28 @@ and 0xA are not. 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 the "llc_occupancy", "mbm_total_bytes", and +"mbm_local_bytes" will only give meaningful results for well behaved NUMA +applications. I.e. those that perform the majority of memory accesses +to memory on the local NUMA node to the CPU where the task is executing. +Note that Linux may load balance tasks between Sub-NUMA nodes much +more readily than between regular NUMA nodes since the CPUs on SNC +share the same L3 cache and the system may report the NUMA distance +between SNC nodes with a lower value than used for regular NUMA nodes. +Tasks that migrate between nodes will have their traffic recorded by the +counters in different SNC nodes so a user will need to read mon_data +files from each node on which the task executed to get the full +view of traffic for which the task was 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 ========================================== -- 2.41.0