From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10])
	(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 98C7163511;
	Wed, 15 May 2024 11:18:23 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1715771905; cv=none; b=MH3sbQHju0wV5pluh7sh1Or55ekVQ40y4oHFJwLq8XaYL0imloMjZ9GGy15yMEsKQx59feNfHPlYb5pC6hEPnq6cXHKy04WLHRVHJpiCV5AHgldfXiLEs+a9+EgSGZRkHdKzPGFhqoWNGhQtMXEUNlzse44RXaAAu/fXRRaLx9I=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1715771905; c=relaxed/simple;
	bh=VJ6A8qhCWtdctbJft4NMBOXHwXvW0/27z0AwmEqovG8=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uhBIyCD7ztK7oWn4uS+CsSh4wyQWOZGq6W0Y2Cg17xl0fnqRrqAGbJaOdssBgBWCUVgPbK7Sh3ni8d3R+E14ewnabk7kfMv4Fzi3bk+v50FKpz9ZyKI1CCRePY6G8D9I2o0AtWZe7dkvOzVKoHqE/Pk8LrpcpVbmk4UrPcD718E=
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=VKbFsqTn; arc=none smtp.client-ip=198.175.65.10
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VKbFsqTn"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1715771904; x=1747307904;
  h=from:to:cc:subject:date:message-id:mime-version:
   content-transfer-encoding;
  bh=VJ6A8qhCWtdctbJft4NMBOXHwXvW0/27z0AwmEqovG8=;
  b=VKbFsqTnQIdk8XSDJ3K+Y8XpU1rOWhge8opctKIn5cbVZu1DgwfhcWJE
   Dl3c3HjinGkprbdGA94kJTpLe58Oo96NxzDdb6HLwrdIG8Oakh9AUd7gA
   +AS6DUq51SUX/0DoMyKTXDpFRtzoTy2ES271DfmK3pGRswQVGJnojXhyZ
   05DpyhWc9+qhQeJuJqbdTnLDivDx4XgzjrMpZMZWODlRHOf9w2L8C0Qo+
   Ai5Vu1s2+Ljl9S4MROIWthV+yuB6VYVKeao2KhLMAgB3EZ/SJjnEH/1fr
   AgG0ANL3DKO1CgcRhrApiSRnsiF0BvdE3+a4MY2cC9lM0oVq/QmTJ3vdF
   Q==;
X-CSE-ConnectionGUID: atrZUZD+SruKkrpRLXj8eg==
X-CSE-MsgGUID: qhH6Zca4SjWiArQAlQI4Zw==
X-IronPort-AV: E=McAfee;i="6600,9927,11073"; a="29305066"
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="29305066"
Received: from orviesa004.jf.intel.com ([10.64.159.144])
  by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:23 -0700
X-CSE-ConnectionGUID: 7tqDk9C+THe11S106FEQCw==
X-CSE-MsgGUID: FrM0xDsMSkWDBpqh96tvPQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="35900916"
Received: from unknown (HELO wieczorr-mobl1.intel.com) ([10.245.245.148])
  by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:20 -0700
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: fenghua.yu@intel.com,
	shuah@kernel.org,
	reinette.chatre@intel.com
Cc: linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	ilpo.jarvinen@linux.intel.com,
	tony.luck@intel.com
Subject: [PATCH v2 0/2] selftests/resctrl: SNC kernel support discovery
Date: Wed, 15 May 2024 13:17:39 +0200
Message-ID: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
X-Mailer: git-send-email 2.45.0
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Changes v2:
- Removed patches 2 and 3 since now this part will be supported by the
  kernel.

Sub-Numa Clustering (SNC) allows splitting CPU cores, caches and memory
into multiple NUMA nodes. When enabled, NUMA-aware applications can
achieve better performance on bigger server platforms.

SNC support in the kernel is currently in review [1]. With SNC enabled
and kernel support in place all the tests will function normally. There
might be a problem when SNC is enabled but the system is still using an
older kernel version without SNC support. Currently the only message
displayed in that situation is a guess that SNC might be enabled and is
causing issues. That message also is displayed whenever the test fails
on an Intel platform.

Add a mechanism to discover kernel support for SNC which will add more
meaning and certainty to the error message.

Series was tested on Ice Lake server platforms with SNC disabled, SNC-2
and SNC-4. The tests were also ran with and without kernel support for
SNC.

Series applies cleanly on kselftest/next.

[1] https://lore.kernel.org/all/20240503203325.21512-1-tony.luck@intel.com/

Previous versions of this series:
[v1] https://lore.kernel.org/all/cover.1709721159.git.maciej.wieczor-retman@intel.com/

Maciej Wieczor-Retman (2):
  selftests/resctrl: Adjust effective L3 cache size with SNC enabled
  selftests/resctrl: Adjust SNC support messages

 tools/testing/selftests/resctrl/cat_test.c  |   2 +-
 tools/testing/selftests/resctrl/cmt_test.c  |   6 +-
 tools/testing/selftests/resctrl/mba_test.c  |   2 +
 tools/testing/selftests/resctrl/mbm_test.c  |   4 +-
 tools/testing/selftests/resctrl/resctrl.h   |   8 +-
 tools/testing/selftests/resctrl/resctrlfs.c | 131 +++++++++++++++++++-
 6 files changed, 144 insertions(+), 9 deletions(-)

-- 
2.45.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10])
	(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 2742063511;
	Wed, 15 May 2024 11:18:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1715771920; cv=none; b=BvvybodZDp39+HtFGD2eGJ0pq12kgbPgiUxY3zKRf0y/8wadug6R99e5wNP9H+44RSn19k5d5U35/BGatjO7etIH2KeGL7OBHWWGgCrnq7wn4ihvrSAHdbaFXVINxuHTpJ+mElMnGx9hzOztrCeJLW1TyiwwQzKqBQOtgyRhq5s=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1715771920; c=relaxed/simple;
	bh=Y7IQI7PBVsR9dGS8sJ/7OWx+WCDZtYU57gfmCodVz58=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=KCsvxj9/1CV6RJJ7QnyWcQEwNM2raQs69ODta72XGt+/akyj1DMcQLQAsmPCuTNLn0QB2LY+S/LHVkC5zXeJqohA+r29O3yCMMfwmX4y3c7HCF/dirW5UHxyqkrNGiPRJTPvXmyVv03Px8JAcJ2B/Vgudj4MeLleOscxN2PNp0Q=
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=dsWEHLzq; arc=none smtp.client-ip=198.175.65.10
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dsWEHLzq"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1715771919; x=1747307919;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=Y7IQI7PBVsR9dGS8sJ/7OWx+WCDZtYU57gfmCodVz58=;
  b=dsWEHLzqgfjEcqGM5QIlBTa1Qg1pkG6Ubn8chIi2dM7l1IY6a3lxU3sE
   x4NPVO0cRBKTmykiZF63/jkSCiHU0XmKvNHhEq0aLlMquef/Sq6Ve0D/C
   tfqBLUaSUuB2UjjwatH+h59slK/c4R3EtOLlfwZhhMjfCavsRLcHVAOky
   XkgxQZSjJ7qeab9SiDtHM616cx26EHaRgkdI1Kb7VmDgSieyccSgcL8sP
   9akI9IVWxTUeq8jscEBnjZsqEN3zjaq0NBzUN87nGSQTiTocdhsKAtZc2
   ux46Z6PG2mQ0rSFYzZe0QAgkyq3+ON/zImSMH+LjbrX+bB77AogPw4+qP
   Q==;
X-CSE-ConnectionGUID: wkGpTVpGSNSghXpjTGg1dA==
X-CSE-MsgGUID: n7q5KPUQRqm5pA7UalAAZg==
X-IronPort-AV: E=McAfee;i="6600,9927,11073"; a="29305083"
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="29305083"
Received: from orviesa004.jf.intel.com ([10.64.159.144])
  by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:38 -0700
X-CSE-ConnectionGUID: 4ErXPwoCTV2ydBLR7sBCNw==
X-CSE-MsgGUID: 2fGtGfZfQ2evtbo0lrTxZg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="35900930"
Received: from unknown (HELO wieczorr-mobl1.intel.com) ([10.245.245.148])
  by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:35 -0700
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: fenghua.yu@intel.com,
	shuah@kernel.org,
	reinette.chatre@intel.com
Cc: linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	ilpo.jarvinen@linux.intel.com,
	tony.luck@intel.com
Subject: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled
Date: Wed, 15 May 2024 13:18:23 +0200
Message-ID: <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
X-Mailer: git-send-email 2.45.0
In-Reply-To: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA
nodes. Systems may support splitting into either two or four nodes.

When SNC mode is enabled the effective amount of L3 cache available
for allocation is divided by the number of nodes per L3.

Detect which SNC mode is active by comparing the number of CPUs
that share a cache with CPU0, with the number of CPUs on node0.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Co-developed-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
---
 tools/testing/selftests/resctrl/resctrl.h   |  3 ++
 tools/testing/selftests/resctrl/resctrlfs.c | 59 +++++++++++++++++++++
 2 files changed, 62 insertions(+)

diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 00d51fa7531c..3dd5d6779786 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -11,6 +11,7 @@
 #include <signal.h>
 #include <dirent.h>
 #include <stdbool.h>
+#include <ctype.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/mount.h>
@@ -49,6 +50,7 @@
 		umount_resctrlfs();		\
 		exit(EXIT_FAILURE);		\
 	} while (0)
+#define MAX_SNC		4
 
 /*
  * user_params:		User supplied parameters
@@ -131,6 +133,7 @@ extern pid_t bm_pid, ppid;
 
 extern char llc_occup_path[1024];
 
+int snc_ways(void);
 int get_vendor(void);
 bool check_resctrlfs_support(void);
 int filter_dmesg(void);
diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
index 1cade75176eb..e4d3624a8817 100644
--- a/tools/testing/selftests/resctrl/resctrlfs.c
+++ b/tools/testing/selftests/resctrl/resctrlfs.c
@@ -156,6 +156,63 @@ int get_domain_id(const char *resource, int cpu_no, int *domain_id)
 	return 0;
 }
 
+/*
+ * Count number of CPUs in a /sys bit map
+ */
+static unsigned int count_sys_bitmap_bits(char *name)
+{
+	FILE *fp = fopen(name, "r");
+	int count = 0, c;
+
+	if (!fp)
+		return 0;
+
+	while ((c = fgetc(fp)) != EOF) {
+		if (!isxdigit(c))
+			continue;
+		switch (c) {
+		case 'f':
+			count++;
+		case '7': case 'b': case 'd': case 'e':
+			count++;
+		case '3': case '5': case '6': case '9': case 'a': case 'c':
+			count++;
+		case '1': case '2': case '4': case '8':
+			count++;
+		}
+	}
+	fclose(fp);
+
+	return count;
+}
+
+/*
+ * Detect SNC by comparing #CPUs in node0 with #CPUs sharing LLC with CPU0.
+ * If some CPUs are offline the numbers may not be exact multiples of each
+ * other. Any offline CPUs on node0 will be also gone from shared_cpu_map of
+ * CPU0 but offline CPUs from other nodes will only make the cache_cpus value
+ * lower. Still try to get the ratio right by preventing the second possibility.
+ */
+int snc_ways(void)
+{
+	int node_cpus, cache_cpus, i;
+
+	node_cpus = count_sys_bitmap_bits("/sys/devices/system/node/node0/cpumap");
+	cache_cpus = count_sys_bitmap_bits("/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_map");
+
+	if (!node_cpus || !cache_cpus) {
+		fprintf(stderr, "Warning could not determine Sub-NUMA Cluster mode\n");
+		return 1;
+	}
+
+	for (i = 1; i <= MAX_SNC ; i++) {
+		if (i * node_cpus >= cache_cpus)
+			return i;
+	}
+
+	return 1;
+}
+
 /*
  * get_cache_size - Get cache size for a specified CPU
  * @cpu_no:	CPU number
@@ -211,6 +268,8 @@ int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size
 			break;
 	}
 
+	if (cache_num == 3)
+		*cache_size /= snc_ways();
 	return 0;
 }
 
-- 
2.45.0


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11])
	(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 A6CF56EB4C;
	Wed, 15 May 2024 11:18:52 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.11
ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1715771934; cv=none; b=NVD9/HQrH/EyP4DzPDEXBDM/uYqL2H2p0sNYCUBHgWEvS7ZXBOqm4zbLGKpbweaWa3IJ2Rj18XomUzoI69yL78YkzG8UdiHeYC+78ZWlDg0U6dv2byf+LOzK+ipf9Z8K45BRlIs7UcJNqdCn8G4evJQRVMElSwsaPPrqwPW0heo=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1715771934; c=relaxed/simple;
	bh=ypmQgTTVuA6yQFrlp0e3Jm4SgrVCOEzrzTi78+uItIs=;
	h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 MIME-Version; b=uoqUtjodN/JdWmUzlZNspl4x8MX80UUx32sEogWNnqH2n2+ghOpq8Fxk9Fe8bsv46Te6enYbx7IgvrNoXGl0igv9vY1k8z5Givunbnc/bbDY47g9olNbsUNr4cIrowTRjHnuRXdp0vbppBhhgVvbHFWdXMgOQn1VKaz5PwPfU0A=
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=D1Lhsq6u; arc=none smtp.client-ip=198.175.65.11
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D1Lhsq6u"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1715771934; x=1747307934;
  h=from:to:cc:subject:date:message-id:in-reply-to:
   references:mime-version:content-transfer-encoding;
  bh=ypmQgTTVuA6yQFrlp0e3Jm4SgrVCOEzrzTi78+uItIs=;
  b=D1Lhsq6uxOvKL/kyu1bEIiQZaRAnCchCOariTxK8B/3EzewyTMOFPKc7
   4BLsB03Pq+pEV24rUcsxkWjZtvxjJSpA00HJQfmjFlkaJJMEDqe0l171S
   jzZWrW7b3uWPVQYbNugfSxcpr3+hVePu5ewl1I6VeZIcLpPBKN21+mwsp
   sP8RRjRqdguMW/4pgqOQZNFuTMm8vskeF136DMNYWbXEwJrwXVqeqEDQF
   cTtuSMMU4x3A/TjchPhuwJBFRTvuMEMVGzKFT4EHbr/PUUHJnTtHs3P3k
   kpy59WianpV/tnSvQ7SRYq3V/kCJizXe0mJEfAqkfOthzlbHaxsY8qgeg
   A==;
X-CSE-ConnectionGUID: nLyMdaVTR0uSGvIUFRHqBQ==
X-CSE-MsgGUID: 99tsPHlWSw+BkIFwj07noA==
X-IronPort-AV: E=McAfee;i="6600,9927,11073"; a="22399428"
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="22399428"
Received: from orviesa008.jf.intel.com ([10.64.159.148])
  by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:53 -0700
X-CSE-ConnectionGUID: n7DBne7AT+GRpJ1utQrarQ==
X-CSE-MsgGUID: wFklm+3eSeisovWVteQwhA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,161,1712646000"; 
   d="scan'208";a="31609018"
Received: from unknown (HELO wieczorr-mobl1.intel.com) ([10.245.245.148])
  by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 04:18:49 -0700
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: fenghua.yu@intel.com,
	shuah@kernel.org,
	reinette.chatre@intel.com
Cc: linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	ilpo.jarvinen@linux.intel.com,
	tony.luck@intel.com
Subject: [PATCH v2 2/2] selftests/resctrl: Adjust SNC support messages
Date: Wed, 15 May 2024 13:18:38 +0200
Message-ID: <16764746e8f9f42cbd45d61210764a9b67085cbf.1715769576.git.maciej.wieczor-retman@intel.com>
X-Mailer: git-send-email 2.45.0
In-Reply-To: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Resctrl selftest prints a message on test failure that Sub-Numa
Clustering (SNC) could be enabled and points the user to check theirs BIOS
settings. No actual check is performed before printing that message so
it is not very accurate in pinpointing a problem.

Figuring out if SNC is enabled is only one part of the problem, the
other being whether the kernel supports it. As there is no easy
interface that simply states SNC support in the kernel one can find that
information by comparing L3 cache sizes from different sources. Cache
size reported by /sys/devices/system/node/node0/cpu0/cache/index3/size
will always show the full cache size even if it's split by enabled SNC.
On the other hand /sys/fs/resctrl/size has information about L3 size,
that with kernel support is adjusted for enabled SNC.

Add a function to find a cache size from /sys/fs/resctrl/size since
finding that information from the other source is already implemented.

Add a function that compares the two cache sizes and use it to make the
SNC support message more meaningful.

Add the SNC support message just after MBA's check_results() since MBA
shares code with MBM and also can suffer from enabled SNC if there is no
support in the kernel.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
---
Changelog v2:
- Move snc_ways() checks from individual tests into
  snc_kernel_support().
- Write better comment for snc_kernel_support().

 tools/testing/selftests/resctrl/cat_test.c  |  2 +-
 tools/testing/selftests/resctrl/cmt_test.c  |  6 +-
 tools/testing/selftests/resctrl/mba_test.c  |  2 +
 tools/testing/selftests/resctrl/mbm_test.c  |  4 +-
 tools/testing/selftests/resctrl/resctrl.h   |  5 +-
 tools/testing/selftests/resctrl/resctrlfs.c | 72 ++++++++++++++++++++-
 6 files changed, 82 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c
index c7686fb6641a..722b4fcaf788 100644
--- a/tools/testing/selftests/resctrl/cat_test.c
+++ b/tools/testing/selftests/resctrl/cat_test.c
@@ -253,7 +253,7 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param
 		return ret;
 
 	/* Get L3/L2 cache size */
-	ret = get_cache_size(uparams->cpu, test->resource, &cache_total_size);
+	ret = get_sys_cache_size(uparams->cpu, test->resource, &cache_total_size);
 	if (ret)
 		return ret;
 	ksft_print_msg("Cache size :%lu\n", cache_total_size);
diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c
index a44e6fcd37b7..0ff232d38c26 100644
--- a/tools/testing/selftests/resctrl/cmt_test.c
+++ b/tools/testing/selftests/resctrl/cmt_test.c
@@ -112,7 +112,7 @@ static int cmt_run_test(const struct resctrl_test *test, const struct user_param
 	if (ret)
 		return ret;
 
-	ret = get_cache_size(uparams->cpu, "L3", &cache_total_size);
+	ret = get_sys_cache_size(uparams->cpu, "L3", &cache_total_size);
 	if (ret)
 		return ret;
 	ksft_print_msg("Cache size :%lu\n", cache_total_size);
@@ -157,8 +157,8 @@ static int cmt_run_test(const struct resctrl_test *test, const struct user_param
 		goto out;
 
 	ret = check_results(&param, span, n);
-	if (ret && (get_vendor() == ARCH_INTEL))
-		ksft_print_msg("Intel CMT may be inaccurate when Sub-NUMA Clustering is enabled. Check BIOS configuration.\n");
+	if (ret && (get_vendor() == ARCH_INTEL) && !snc_kernel_support())
+		ksft_print_msg("Kernel doesn't support Sub-NUMA Clustering but it is enabled. Check BIOS configuration.\n");
 
 out:
 	free(span_str);
diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c
index 5d6af9e8afed..74e1ebb14904 100644
--- a/tools/testing/selftests/resctrl/mba_test.c
+++ b/tools/testing/selftests/resctrl/mba_test.c
@@ -161,6 +161,8 @@ static int mba_run_test(const struct resctrl_test *test, const struct user_param
 		return ret;
 
 	ret = check_results();
+	if (ret && (get_vendor() == ARCH_INTEL) && !snc_kernel_support())
+		ksft_print_msg("Kernel doesn't support Sub-NUMA Clustering but it is enabled. Check BIOS configuration.\n");
 
 	return ret;
 }
diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c
index 3059ccc51a5a..e542938272f9 100644
--- a/tools/testing/selftests/resctrl/mbm_test.c
+++ b/tools/testing/selftests/resctrl/mbm_test.c
@@ -129,8 +129,8 @@ static int mbm_run_test(const struct resctrl_test *test, const struct user_param
 		return ret;
 
 	ret = check_results(DEFAULT_SPAN);
-	if (ret && (get_vendor() == ARCH_INTEL))
-		ksft_print_msg("Intel MBM may be inaccurate when Sub-NUMA Clustering is enabled. Check BIOS configuration.\n");
+	if (ret && (get_vendor() == ARCH_INTEL) && !snc_kernel_support())
+		ksft_print_msg("Kernel doesn't support Sub-NUMA Clustering but it is enabled. Check BIOS configuration.\n");
 
 	return ret;
 }
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index 3dd5d6779786..2bd7c3f71733 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -28,6 +28,7 @@
 #define RESCTRL_PATH		"/sys/fs/resctrl"
 #define PHYS_ID_PATH		"/sys/devices/system/cpu/cpu"
 #define INFO_PATH		"/sys/fs/resctrl/info"
+#define SIZE_PATH		"/sys/fs/resctrl/size"
 
 /*
  * CPU vendor IDs
@@ -165,12 +166,14 @@ unsigned long create_bit_mask(unsigned int start, unsigned int len);
 unsigned int count_contiguous_bits(unsigned long val, unsigned int *start);
 int get_full_cbm(const char *cache_type, unsigned long *mask);
 int get_mask_no_shareable(const char *cache_type, unsigned long *mask);
-int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size);
 int resource_info_unsigned_get(const char *resource, const char *filename, unsigned int *val);
+int get_sys_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size);
+int get_resctrl_cache_size(const char *cache_type, unsigned long *cache_size);
 void ctrlc_handler(int signum, siginfo_t *info, void *ptr);
 int signal_handler_register(const struct resctrl_test *test);
 void signal_handler_unregister(void);
 unsigned int count_bits(unsigned long n);
+int snc_kernel_support(void);
 
 void perf_event_attr_initialize(struct perf_event_attr *pea, __u64 config);
 void perf_event_initialize_read_format(struct perf_event_read *pe_read);
diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
index e4d3624a8817..88f97db72246 100644
--- a/tools/testing/selftests/resctrl/resctrlfs.c
+++ b/tools/testing/selftests/resctrl/resctrlfs.c
@@ -214,14 +214,14 @@ int snc_ways(void)
 }
 
 /*
- * get_cache_size - Get cache size for a specified CPU
+ * get_sys_cache_size - Get cache size for a specified CPU
  * @cpu_no:	CPU number
  * @cache_type:	Cache level L2/L3
  * @cache_size:	pointer to cache_size
  *
  * Return: = 0 on success, < 0 on failure.
  */
-int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size)
+int get_sys_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size)
 {
 	char cache_path[1024], cache_str[64];
 	int length, i, cache_num;
@@ -273,6 +273,44 @@ int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size
 	return 0;
 }
 
+/*
+ * get_resctrl_cache_size - Get cache size as reported by resctrl
+ * @cache_type:	Cache level L2/L3
+ * @cache_size:	pointer to cache_size
+ *
+ * Return: = 0 on success, < 0 on failure.
+ */
+int get_resctrl_cache_size(const char *cache_type, unsigned long *cache_size)
+{
+	char line[256], cache_prefix[16], *stripped_line, *token;
+	size_t len;
+	FILE *fp;
+
+	strcpy(cache_prefix, cache_type);
+	strncat(cache_prefix, ":", 1);
+
+	fp = fopen(SIZE_PATH, "r");
+	if (!fp) {
+		ksft_print_msg("Failed to open %s : '%s'\n",
+			       SIZE_PATH, strerror(errno));
+		return -1;
+	}
+
+	while (fgets(line, sizeof(line), fp)) {
+		stripped_line = strstr(line, cache_prefix);
+
+		if (stripped_line) {
+			len = strlen(cache_prefix);
+			stripped_line += len;
+			token = strtok(stripped_line, ";");
+			if (sscanf(token, "0=%lu", cache_size) <= 0)
+				return -1;
+		}
+	}
+	fclose(fp);
+	return 0;
+}
+
 #define CORE_SIBLINGS_PATH	"/sys/bus/cpu/devices/cpu"
 
 /*
@@ -935,3 +973,33 @@ unsigned int count_bits(unsigned long n)
 
 	return count;
 }
+
+/**
+ * snc_kernel_support - Compare system reported cache size and resctrl
+ * reported cache size to get an idea if SNC is supported on the kernel side.
+ *
+ * Return: 0 if not supported, 1 if SNC is disabled or SNC is both enabled and
+ * supported, < 0 on failure.
+ */
+int snc_kernel_support(void)
+{
+	unsigned long resctrl_cache_size, node_cache_size;
+	int ret;
+
+	/* If SNC is disabled then its kernel support isn't important. */
+	if (snc_ways() == 1)
+		return 1;
+
+	ret = get_sys_cache_size(0, "L3", &node_cache_size);
+	if (ret < 0)
+		return ret;
+
+	ret = get_resctrl_cache_size("L3", &resctrl_cache_size);
+	if (ret < 0)
+		return ret;
+
+	if (resctrl_cache_size == node_cache_size)
+		return 1;
+
+	return 0;
+}
-- 
2.45.0


From mboxrd@z Thu Jan  1 00:00:00 1970
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 D273939863;
	Wed, 15 May 2024 16:48:57 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.21
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1715791739; cv=fail; b=EYQBsob4svxWphH+ixAm2Vmep+FgjzOwWzgVB8T9f0qVH2YCbKn5pdyVC7lX1VkvHQ6WzjPqJji4bZ4uIr2FWfnA/bKFVM3WCNMyaE1CO1MMHtouT0/rCl+dyU+cg1JR8l+wl9ME7sbEs9PwKoB2khb/h3U5LAuZgBCaRqdjg/0=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1715791739; c=relaxed/simple;
	bh=XocV8HYGFxyh31l9Aw86uGdFXo1FFAT4gSPD+9rzgpc=;
	h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:
	 Content-Type:MIME-Version; b=uUau0mC+9mF7rj+zMkm0UH1ruEvw/WlQrfRKoYBgINlHuI7T7XU/qNEZAjszHXt4bzuBMADpBAIP7QE4xriYD1BjaU9OoQZDPCamV2mUIoNwZd0kjLyrHbD9haWexd0ayu9JAb5PWkHsqV9e3f8cLmDlXG7P1O2HAPj+vJ1vqOw=
ARC-Authentication-Results:i=2; 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=CDSS3ECk; arc=fail 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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CDSS3ECk"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1715791738; x=1747327738;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=XocV8HYGFxyh31l9Aw86uGdFXo1FFAT4gSPD+9rzgpc=;
  b=CDSS3ECk0Vw0fw2mnSlPj+vLQGSklL+3n5REZXFIK51Wsa7cE6ROWu8J
   Ah1xTGjLrdW2dc73PH+FcixjF48X5zb4/sy58j0YDM0PPvfbS9G711n/I
   yg+1h0n4xKkeRukcaFjSmTHPLr/9snPyDm/b5inE/4x9a+ZkyY+2jHGN3
   0SwXoeOeYEBYl+WNo+5fRzQLYcTEqLUrD76sW54WNPq57P0RwmaXohYI/
   mhtLQolPFLbLyFvzyJ861BuGNoAnEgWfLYWxIyNR4yiqQrdwtDNHPMfrL
   tfygG+EYhXbsL8L9WClbnJNvc9kNG1XjnmJMj/9KxirnzXKOrKiYxEIAJ
   Q==;
X-CSE-ConnectionGUID: X2obMZUrT2uu+qxBBbbnmw==
X-CSE-MsgGUID: EB9KjMRnQN6nr+JIZCT1Fg==
X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11799942"
X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; 
   d="scan'208";a="11799942"
Received: from fmviesa001.fm.intel.com ([10.60.135.141])
  by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 09:48:54 -0700
X-CSE-ConnectionGUID: d+19vQXYTtaEXp2YM4rBWw==
X-CSE-MsgGUID: QVkvdiS2Q2+x0uScJw6P7w==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,162,1712646000"; 
   d="scan'208";a="62315794"
Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83])
  by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 May 2024 09:48:53 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.35; Wed, 15 May 2024 09:48:53 -0700
Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.35; Wed, 15 May 2024 09:48:53 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.35 via Frontend Transport; Wed, 15 May 2024 09:48:53 -0700
Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.172)
 by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.35; Wed, 15 May 2024 09:48:52 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=K4hJvu2l3M74xLNcuBlZzSEPiXCxRWXQsgyr5jGkARqs5X83ZFOtZmMiXQd1eNMEtMFOCowVNNmSQVtHFqVQqX0qHjh8QeZuM03CXKXaBZR5r43ob3WiiSRIyD9HL7aortkJ6aMakNjfgVJeja4E2PxsJcMIyr0QgdLwl5DgzP74+96P5btVZtwfga0blOZYCuvbK74jXNaJSyemve6I+7WSAUnGNixnP71EaIC7+7roypmPxmDGvjj+jQKGi4Q6ZXzh7tY3uIm5u42gLYyrwhHcEfjXH2r46wu/WYGgYZt2tat5V+95+bM2rHI7EnYZyx++ogtJwB3qz5dXgh3Mlw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XocV8HYGFxyh31l9Aw86uGdFXo1FFAT4gSPD+9rzgpc=;
 b=hZ5TSM3EbKcbq2IH3DeC9GCGEbnjh8zHSLMaa+NkS1Qi4KE1iVrhjVoPhyx9bGOfAzvhB2DsKMalt0BxcNWG2Fu7hmnE4tufEJ7cgFLEdBKa8oyd7qQSu/y2sXxvZ2tqUA9V99l2gILfeQC8YIZ1jnyzjiasrWHxQz8XSxgSjermlo2rovTX5dyl4l+sIpkPqen9/mQrrzUFKoI3uxyR5BVE77pMTyV9O0EK+Bd1rjCLbtgMQGsxLPwIRI7BNI4Ax+CS0KuB4lrKmb2L0pJVR8cl6wawr9x8GmkhG1ZfUW9yXTJ44wpBrTapIRTjweRJLmMMazQ5V6jJWUN70DuJZQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com (2603:10b6:a03:48a::9)
 by BL3PR11MB6363.namprd11.prod.outlook.com (2603:10b6:208:3b6::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.55; Wed, 15 May
 2024 16:48:44 +0000
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361]) by SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361%4]) with mapi id 15.20.7587.028; Wed, 15 May 2024
 16:48:44 +0000
From: "Luck, Tony" <tony.luck@intel.com>
To: "Wieczor-Retman, Maciej" <maciej.wieczor-retman@intel.com>, "Yu, Fenghua"
	<fenghua.yu@intel.com>, "shuah@kernel.org" <shuah@kernel.org>, "Chatre,
 Reinette" <reinette.chatre@intel.com>
CC: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
Subject: RE: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Topic: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Index: AQHaprmme8fjFWvJ30CJk2uljzCiTbGYgXWg
Date: Wed, 15 May 2024 16:48:44 +0000
Message-ID: <SJ1PR11MB6083320F30DBCBB59574F0BDFCEC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
In-Reply-To: <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ1PR11MB6083:EE_|BL3PR11MB6363:EE_
x-ms-office365-filtering-correlation-id: 98327bb5-46e0-46cc-48e3-08dc74fee213
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230031|376005|366007|1800799015|38070700009;
x-microsoft-antispam-message-info: =?us-ascii?Q?SqDypS5C1C02V1qGMA5bESsJk0txyHN5mWBSSvE45iltFBwZpTZ5F1st1PtR?=
 =?us-ascii?Q?igZTbO7aDqxkU02kBSkoumbrG8Hr92BbBFgpa2gDtENrsBlaRbhmIM45Ytqq?=
 =?us-ascii?Q?CrRSvzeA2NjKaE1xfrrGXLnrb+e75H3GxOzeUSiwV3GgxF3S8Xk8IvOSrFOL?=
 =?us-ascii?Q?5vNczPPTDMablpi7UUse7u4uvvMJcaBSfpfcNUZNnFjfwDKUQdfHxyiudJn2?=
 =?us-ascii?Q?E1l+1m0Li35vf02wgeDapiaImOLlrCsZNItn0BejRgW3sTQCb7oi1Dkqdpy0?=
 =?us-ascii?Q?7z2p/Vk4NHiJ9PKWIj+V9eENSe61U53/CYCUkrdhluXL+0/yDaRIR7QS/XkP?=
 =?us-ascii?Q?JeX/jjMV7u9CuPAoOzCy0jXZ3zgSTpCyJYG+PkioNGc3H7yPJeM/WmPQyWtY?=
 =?us-ascii?Q?8VGcCxXIcLSor6kxxQmwi24iDmYf/JUMYQv2piUWGNwMe4wZ635R7m1PQm4e?=
 =?us-ascii?Q?2JfZz1zEn+G45aRDIAb0dWt35HuzLMwAKt/qpmUNp39F2G7U/q0PpqZW8F2W?=
 =?us-ascii?Q?Yu74ScGhPa7qFUU4tsg3WCIrTTTw4hu0vjPgm0Xf+RTfsD+DBOWpCLI6eXPc?=
 =?us-ascii?Q?Sua12klY6fLNHAZIbxwAoDcDT1yFh7kjT6XmZcpa2I1zVP8+FM0K+1mY7o3i?=
 =?us-ascii?Q?TMv4PackoU92C4nnIFvUpKknuIC4fpSDHAFGF9VDr95hjsI2aV71i09JhuXs?=
 =?us-ascii?Q?UgSbymJWAWT+Gl9X9S1H9Yh7apjLdDDYWhNGHi/yo55hm6ONh6VKmmNDNzKp?=
 =?us-ascii?Q?0rm+oIKc8KntfZXAh9YVhYZ7jobTuW5vm58cpw0whd5JsuH5iaNcpt/x0QAZ?=
 =?us-ascii?Q?/7OliU8OWYJrFTIcmeO5ezcCoA/C2+A6YJYJa/23MSXuWML6+1CU1mwxPc7X?=
 =?us-ascii?Q?3xjfW1A1ttNIkNz6sU49EHUk8nzhyxWe0rcXEOvSetdkazonPAcol+HZueF9?=
 =?us-ascii?Q?MsgujB5IcGN5qdGIzjN8mnyElky8NS1iNh4m71Qg9yS9vs0Ut+qdIbeMb8gN?=
 =?us-ascii?Q?Jf+Dj2uVg5d/FoYcNijxU1Z54AsK3c/Ed3Lz4LXq277sbKGpjRwiMK7hO8ii?=
 =?us-ascii?Q?E6gcJKmGTTZ0i0gyNRfYzrw55HhR1PupyNwlgfrWyaTB6lURZzZDvsUDN7s7?=
 =?us-ascii?Q?rV11XeUaIFfxQXdzFzN81MpPYdRLnmi9/H3knIcTHsq6+akf+hIX0sm42R+1?=
 =?us-ascii?Q?xERw5hatKgtUI2O+1zo0Jt5cOUrGOFPqThZnwbq41rx9A1yLIiaH6WXx5cuN?=
 =?us-ascii?Q?GYJbM8mFjHnl5W/mHPILRXbKkFvdGLuttqYWrUFWc0aDLsIX+VYraQd4Cx+9?=
 =?us-ascii?Q?HVBD4vz1qLp1RUt5rm3RiGA9fwp5FpxibHAECGtbllvsZw=3D=3D?=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ1PR11MB6083.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(366007)(1800799015)(38070700009);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UXSgKXToHBKMvm6OMfEh1HPx6D+Bij4ziuerD7YHEfWNshluPtEmmIYTkz/k?=
 =?us-ascii?Q?HGAcbKzphC0cqiQqU1w+x+0KBj+RPtd1AjX+7G7K0EGY8Z4SzdnDDSX6bnhT?=
 =?us-ascii?Q?O7/Wktk3SflgCAsHsAz6OX8LrMFgAj6x0PkSf2gMuW7RXAPUsVwJZ56Ij2nO?=
 =?us-ascii?Q?3KanO2BAG1M6Kz02IxtUERRnIb+f94u73bz5/XGRMMmi9EyyWWZreeHMl3Yn?=
 =?us-ascii?Q?hqFBSJnsQvjq7B3r80bilkQAVMw9eXNHCrkr0zF3wDVbwz+EqCWjPUWj9FjT?=
 =?us-ascii?Q?b7s/eLriXdD14RV3D2QLszVUvzZYipdnWn6vvRKMZpT3brcddV01ykJC12g6?=
 =?us-ascii?Q?OWqq24bBt3j7Lp3dPneanj34cIaDkzKzMfz6qn2KQFDvka6t2NJOxRR4B/bz?=
 =?us-ascii?Q?9D9tD3dtWwDhCmqq4OwsNNOqat/nDu4uB0QDJgHYgaeVuCB2ao0N+wiAWdQK?=
 =?us-ascii?Q?G91eYXa/5AnaHOMl6zadzTw3gxDfSh5SRyqd93aKusKhpG3hq5m6U+F0EnDm?=
 =?us-ascii?Q?MpddAp43zIyVtJW2a8h1GQrvYOWgLNVhbzA5RRpltyybKWBJGn+nTkA+y5dQ?=
 =?us-ascii?Q?jpBlgThDeYyQdF0KjigAp596dnLPw1q0vZKwaxUlRbpjKVf7BFNwiATgKlEC?=
 =?us-ascii?Q?q//UM6Ljasor5Aqd8W6d31jGvyfR0yM+fdiXIQBXSSfShNzDs1tStxrzlaG1?=
 =?us-ascii?Q?R4FLVeAg+ZQdKtRc/aqpaKhf/j90a1wEjvQzcst4r+apsFpP4xgOktbNkOOG?=
 =?us-ascii?Q?z/t2WyPVwLx+EzBWGviU5Nnxd3wksFGB3JGA0KnhqlSWEch+p1xKqsUFeOpq?=
 =?us-ascii?Q?24Vk9+khkYfdrPWr4/msyWQFNiYnF1bpFVjLIaC7ez1Ds9eWwSjuZvR6mxaE?=
 =?us-ascii?Q?6vBcHGx/Vs7IUrQeyLkI/Diiql1at0XsnoT7r0HVfQGuynTa325bF8rpw0ve?=
 =?us-ascii?Q?Y76TzGsN4a5u+aFJRvFoJd/4GyKkzXt5EvP77DRcu4V+llDsOMCz13b314id?=
 =?us-ascii?Q?hiiBdbWkuH8bTrXZ1On02LK+2+hIw9mSShKxZuCiOO6bbOKgOdLevz8mj70C?=
 =?us-ascii?Q?bIp5sXTZcm38MnzE1YxUocAVX/opLAOHw/HUYEbSk8OWRR72rYabRyzuB/V2?=
 =?us-ascii?Q?eLk3tAhspWi813hAQfaEhOQaCehaqtlIl26oPtk4YsXkoQxG6vYyaNtIWa0y?=
 =?us-ascii?Q?XTb7UGR7mdHUxvpEA2Vitr9GBc6KSMIxbu60cdxsxdpNd1iz2s2M0EKr6cRI?=
 =?us-ascii?Q?BQPhAfnU+yqsUqCwNnKL1toSwtlWEu4VV0+usGxDqpTMxmMLOXd+QA9UpiVj?=
 =?us-ascii?Q?gzXg/n/ksb9ILxpl76RwpJZmldTkGL2xaANcvQnkpKgzbWdDjVR1a+rotxYi?=
 =?us-ascii?Q?2COMqAhQsNlHMkwDbBR4Dd1eQfFi/AjVWdl7NThvxSVjLe7SOmOxYhOa90km?=
 =?us-ascii?Q?3RqxNVnpXAu/N+5gcm3KQHyT6a1V+dPsYIf5+o+iTjOrqjO70bP1fTFNhEXD?=
 =?us-ascii?Q?qvBgN/ithfjSxeLykVCoyB1osN9JjJ4xKLb16Asod5K0FW6Nh25XrBTQYPvn?=
 =?us-ascii?Q?pHVrCGkvD9E91e8uEOh8qTj7+i7Pvn7tnU0p/ljX?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6083.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 98327bb5-46e0-46cc-48e3-08dc74fee213
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2024 16:48:44.2851
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 6kcpZzwEaJDU8V/krJp6hOZAekES7OSN27RTAGGdw86R39EhzhFS2DnO2MGqBmcq8wN4zrDXU0FdZJirl74TQA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6363
X-OriginatorOrg: intel.com

If/when my SNC patches go upstream the SNC check could become:

snc_ways=3D$(ls -d /sys/fs/resctrl/mon_data/mon_L3_00/mon_sub_L3_* 2>/dev/n=
ull | wc -l)

assuming you have /sys/fs/resctrl mounted.

-Tony

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18])
	(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 81EF1847C;
	Thu, 16 May 2024 06:01:32 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.18
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1715839294; cv=fail; b=jXdxU3tDWPb6lj/4GB538vRyYDMFAYhS3kKPrXnSna8wegLA82qQQzciQvnaTc83QQyGOoSWxtGS0jhONPfCQbGlBDEaIFDvmoalNbeaKNK42nU3er/NeqEf0OqXKuFmVDCOqVWSAUwmchiqQv5qDozczx3gV96vz6SZC8u9o3A=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1715839294; c=relaxed/simple;
	bh=eWBVm7BVOrOcZffgVY3yBbsaFnm3h4BNrXsMJbGq6Ic=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=E6RSy89tLHtd/Y9oKMzIIVMb5XmjYYaTYh/9GeLNTC493KDanDnl+bZ55Yv4YqVGPX6PFp9ZXnWTf1CkS0BeQ34EH3ua1iLgy2Hd7iWLvoyyQp70vxtLHz8tzD6g7JVk8n2ulKV1jQwnJnCFWjCLglgOvcAaXpy5kDN9mNWFjPo=
ARC-Authentication-Results:i=2; 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=Yezi5NUn; arc=fail smtp.client-ip=198.175.65.18
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Yezi5NUn"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1715839292; x=1747375292;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=eWBVm7BVOrOcZffgVY3yBbsaFnm3h4BNrXsMJbGq6Ic=;
  b=Yezi5NUnWxbv6QK08Fp+fEQA3IVFBXz+9uBTTd5o39rSleOmf0bYZSnR
   MB6JbMFOLK4xPv2aMDg/6MwdfTCFNLWcdRGkh4IpxMwcizAsZE1iStnvO
   TSUuLGFSgefaaYVqjKhP2EygBs/vhJPPyHkbyl6DQCL18hHBKVFg5LWvN
   6O8DTJhUJxeh2RBjpunFK77INvZs2jPhDbF0DZhyYJl37PQch0ZR5AhQC
   C2GprSXRzC54dN8Yze8UdShbUmzks7pvhTgNWfs7IZ8OD9rZccR6bKW3E
   ohHbrkp8pkOfb1QfpLlpbeYi5SHwgZXg3+nqkOEubLMSNEICKVKo7cqn7
   w==;
X-CSE-ConnectionGUID: OVIB2FyqT6aklF5TFyWq0w==
X-CSE-MsgGUID: mPMcSfDGSpuhFyWoIHlu4A==
X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="12090770"
X-IronPort-AV: E=Sophos;i="6.08,163,1712646000"; 
   d="scan'208";a="12090770"
Received: from orviesa010.jf.intel.com ([10.64.159.150])
  by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 May 2024 23:01:32 -0700
X-CSE-ConnectionGUID: VL0LYJSfTzehEqPR5UYqsw==
X-CSE-MsgGUID: SPxuYjdDSo+fPMKT2UceaA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,163,1712646000"; 
   d="scan'208";a="31137173"
Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16])
  by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 May 2024 23:01:32 -0700
Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by
 ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.35; Wed, 15 May 2024 23:01:31 -0700
Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by
 orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.35 via Frontend Transport; Wed, 15 May 2024 23:01:31 -0700
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169)
 by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.35; Wed, 15 May 2024 23:01:31 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=c8jFXgQY087UHiM8FMphIHHmTeIpsRwvSBOJmT6MkCAa6B7jC9wDyw4vItxQ0kYuPrwnWWd+irc/SSUDDnetjmare1oTEiKt51+/LEy8PG8PJOP6OGYjMpRHoPFMPz8JzIyYK6TpX79BUJPoZAxdInmiW71LVTvxE8qKXw67fOza9d3lPJ43oF45ZRuIfeHB8LqdsVI7Ch798COIlwzHViWFYuYXHYtKbj1n8freOiO5qfXE9eCrPojp2PfXu9sB2jBvszaFvC2pu7y8TQVZxkQPeNog8nfqI4ZuzY+VzTurbEL/XWiKSlCLexb05sQ4O5WDS3YbBZjRSn2g0j4aLQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jPJr18JHNfb7Bjk6NpI8FZXs8QSuWJaQ05KuhmqlwmU=;
 b=XSYtfRWENfowpdVcy9jK9weHTLLiY0uLUPyqTsJm6cN1P5SXs5jOyOf7QZNuGJo+QITpvmxnVg3Oc9L1MyxDpeo4r2PlMooJezR3q6R/7fvRXGwuWVJBMIAWrTCHaAzqHRVhl9IDGh7aNO5X3bIzYfIZPXH2LdAeAHVzR1HTJt25Th0mlFsnsJQApJstTb0l9CihdKsS02IhJZHNZZc/q/q4P4O/3mhv5s7bXYy8AK+5mFSL3F7QuD3ZCWa0MkLEFwumQDIjX5MKc9URh3eeN/1HRleQQuconJLU2rZ1H+8uPnmPYkDdoBcIn9QIKs8LiSc2sv9xs5qzGrY++MxI/w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by MN2PR11MB4710.namprd11.prod.outlook.com (2603:10b6:208:262::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Thu, 16 May
 2024 06:01:30 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7544.052; Thu, 16 May 2024
 06:01:30 +0000
Date: Thu, 16 May 2024 08:01:17 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: "Luck, Tony" <tony.luck@intel.com>
CC: "Yu, Fenghua" <fenghua.yu@intel.com>, "shuah@kernel.org"
	<shuah@kernel.org>, "Chatre, Reinette" <reinette.chatre@intel.com>,
	"linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Message-ID: <7apqfgfcb3mns3dmnmvwlvuhbqn6yht3tprrcd4lyavt27u5bw@bxulqnh6blle>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <SJ1PR11MB6083320F30DBCBB59574F0BDFCEC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <SJ1PR11MB6083320F30DBCBB59574F0BDFCEC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
X-ClientProxiedBy: DUZPR01CA0181.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b3::22) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|MN2PR11MB4710:EE_
X-MS-Office365-Filtering-Correlation-Id: b9261b90-37e4-4ff1-da87-08dc756da15a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?fHhJ6Ac0BH/KbqO0GMM0vHK6s2vliHo56/RiWdnRI624/pDJf9+iuPYIfd?=
 =?iso-8859-1?Q?uVM2iSuDiz5nNEToO3l9h+hSLIRUXDRH69svitjMTrkfQx64tiiW5atA7U?=
 =?iso-8859-1?Q?Cpb5N2Rgi5+BRq36gvtIoi+bLY4F0e9aFnX9GPUTljSpZefQvgg00+MprB?=
 =?iso-8859-1?Q?D6fKx4+tvZGwoqsfpEoDk9c1t/yb0BrFpWLsq8rv8yktintF9wyv3MnZLu?=
 =?iso-8859-1?Q?CHDsxH26io/n+mSrbrrQS64Eb2I/OHzsYBUIXO1UeeF7PAB584D5fSEVrV?=
 =?iso-8859-1?Q?/fwxK9tsg1uE2Cwu8Qv+74CS5u0Wm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rzvRj9gJ7RqKeCEN0cdpEayPKoLCG5?=
 =?iso-8859-1?Q?DFQJWWbWC0fc8K5X+Zbb7bdMMYuIyDq883VkIRrM9gT8aMLYbReGzynlLS?=
 =?iso-8859-1?Q?9R71lmqUuuwPBicy61+ldAGg7me/iNB0tW5T/5pA+8zhO7+JjbwX3ZJolg?=
 =?iso-8859-1?Q?pu3Xsmt31Nsmf9F9FRlDbuSb2A=3D=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?LgJq/XBNxVNfdk293Itr7gPOrD8gF9Dzpl9UO4gPYtRj5WcOzOhJJCY9Er?=
 =?iso-8859-1?Q?x6rH4HxVLv0t6QzxKAMzjRWBmZi4kfjHIaHChSNgf/klP3cHALpARWpah0?=
 =?iso-8859-1?Q?0NohRJGavwlV7Gh+PRRmonin+HNqIWrho/2HXWIQwcDd3obbg0TfE9IAWQ?=
 =?iso-8859-1?Q?crQHWqL5w+K9PgMZhqiXskC2iQ4LEcO5Uab743hQ1GEilw+a348PFGkvXc?=
 =?iso-8859-1?Q?+WbDfCOPdEVknWVY8zmJZbskNWPG9ZrcH+KhoahJ8EGjObmcHwjVv4Hzx2?=
 =?iso-8859-1?Q?CG3N+D5cA+QPtnRDLGCLikrRsn++/7ZgYr/iYaU+E1Hn30YhpQ+Zp2Pm+m?=
 =?iso-8859-1?Q?zIqE9yJYrx+MOu80EZ80db9vZ9MgFIp1dbMQf0gUeJNPJeybEtDlb3cZUU?=
 =?iso-8859-1?Q?TVlohmS2lsouIqIw5zDjVU1mXBv+taOOy3KOtGUNfJvDm3trsWF7nSXoGg?=
 =?iso-8859-1?Q?CUd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oupSZSSQDpsaRAt4NDPh7D/LKh4VbD9FiOMz8bxyZ?=
 =?iso-8859-1?Q?yAnKRMHJk39reBwtTYEEEeqeaweYmbQvLvqiv7Ec2BQP/q57+Layu9WE9F?=
 =?iso-8859-1?Q?WcGqys87On/H/o31DCFbE1FfnceR2Gxh1yCESN0KSvjRjI2eNYz0Ag3PH6?=
 =?iso-8859-1?Q?jg5QrasFEdmxMePNx2+xR5UX5ketIxTyR3Vflwz1Mnd/QlhYHPpqXFJtkO?=
 =?iso-8859-1?Q?PX+/OiZLLZFsUQCYeBu4YS2voPSUcV1Ek5ysM5jjYMj0rNxepbudFB3l4Z?=
 =?iso-8859-1?Q?dj1aBLAoJ0iSq0uCc7MpEtebL9kSzb6X8Dm7dGqad1zcLNb4+IWTd9na/o?=
 =?iso-8859-1?Q?JYCTnOpQWEyKo05aciU=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: b9261b90-37e4-4ff1-da87-08dc756da15a
X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 06:01:30.0223
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: wxlyqT0RGRpt9FJQzHYD++/VNFt7qAgLdgoATnxQqrXFZhTclJRj2Fb9elhSZTPa5sRp4/XohBeMQpzE7jAf806GbZRzdutZEXHkhwa9u0E=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4710
X-OriginatorOrg: intel.com

On 2024-05-15 at 16:48:44 +0000, Luck, Tony wrote:
>If/when my SNC patches go upstream the SNC check could become:
>
>snc_ways=$(ls -d /sys/fs/resctrl/mon_data/mon_L3_00/mon_sub_L3_* 2>/dev/null | wc -l)

But this won't work without your kernel patches right? 

If they are already in the kernel used by the person launching the selftests
then there shouldn't be any problems to report. The idea was that if the
CMT/MBM/MBA selftests fail, the message with "SNC is the problem" is only
displayed if SNC is enabled and there is no kernel support for SNC.

>
>assuming you have /sys/fs/resctrl mounted.
>
>-Tony

-- 
Kind regards
Maciej Wieczór-Retman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11])
	(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 874BE13B290;
	Thu, 30 May 2024 23:07:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.11
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717110457; cv=fail; b=MmlNEW4vx0VexnefNlGrRHodIbLdDjRJVdJSZ8M5M0l/Dg+3aV1NbgGDjBk67tBPelbPl2RyKLZcyZgv/jKhzPhc7HlomLaESU/ovycAYVOEttp/P6GK+h45xYLK4tQnFucmida9JmdugCOFd1Kpzv1TN/xPFGbralpGQMvM3Kg=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717110457; c=relaxed/simple;
	bh=nQRXrAfmKMIFSIFUA+cFDJH/lCIOesmGiifIyCNWNLA=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=RkdC1hBqdyJ6l3uNqxmovm9+lSxK7pIDzGknPUjZVpOv5RJnn2mi9b0Ch6srdIlRY5tiYVTuZLROgZpzvEVo38wXwbNpng9vZHOQVBU5niNFrcugdLb62X1mixtN74A/Vx/RNi2nDubcyXPQ3ElgjErX6ZkJpxHj993C/Alr/8g=
ARC-Authentication-Results:i=2; 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=ibQFs6nr; arc=fail smtp.client-ip=198.175.65.11
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ibQFs6nr"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717110455; x=1748646455;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=nQRXrAfmKMIFSIFUA+cFDJH/lCIOesmGiifIyCNWNLA=;
  b=ibQFs6nrxzBFIwStilvguOYo1UYEzs+gxYGnLg1vv1NQZvLEDR9WbLfh
   m3eMOc6o3UW8vQomz17HmhDWCwygnlbViagT8ac0EOTfMO1xhHyABW9hH
   Z2LVSbJ2uWMTCPYyCjBtiuFcCrQV7f9vtnqrpRNf5w9UEP49TWXoHk3Gu
   OBkB9kXy+TyHNupCqjYrLVVoY+BKmQSfYdJE4PLRCM7BGPb6yPIIzMYLB
   nwI4hUf5U+EvGwfQhTmmXCRGfrzZ9fN0OU0WD3R3c0ot6pJBi5b1+YMCg
   W6q0N7N+H0jFx4VeVfbvXRVgujXyszDZ1viqheLr4ECEVq9y2OGZFtT3o
   Q==;
X-CSE-ConnectionGUID: hO9sNQ7/QdeLXEGAjdNwRQ==
X-CSE-MsgGUID: yMw7Ufa+QGW8QwXK1ZwSkQ==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="24196316"
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="24196316"
Received: from orviesa009.jf.intel.com ([10.64.159.149])
  by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 16:07:35 -0700
X-CSE-ConnectionGUID: pbNiV5TgTpmVHpRKDVlIfA==
X-CSE-MsgGUID: 7pux76rGQDeLaUL2WfPerA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="36069709"
Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14])
  by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 16:07:35 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by
 ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 16:07:34 -0700
Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by
 ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 16:07:34 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 16:07:34 -0700
Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.169)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 16:07:34 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=L02OM0Ok0hEy1GYIvyBhEhd5xgp2N5d5S2Zuz++q8BGXhjtjbLYga0rdXmh6bkCTx3fabca8Tc5WqthooSf/UaXOkJR/SVbbBD8mta4EZme1M/njQGvf9qEUX2Z8dVl8913m+S6L//nklRFd725mizotzourscBlrSn5e3ySMgf+7UtSmBZVPH9E4ZT+vNNWSd+bflJ0tWlop/P/ML+Tbnah6p/xcnVbPtW86UTB3ib5dD7mSbXfzFabjU5qpVepZtFxYNNrxqcIFTp1aZCjuJ/NmGDgOn8jTgp0NWneNTf+zYUAX9abtveR1cFyISBKU7YIzo1iZKNwicQOlO5Ecw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Pp2cYQBHk9glLGr2F0PJMdMENY1OFdQ65ZXYysJHYL4=;
 b=M9cUbugZdxzAMxTAhgH2ZcT4+bg0Fj0q6iiiDp8epX4lkokhBkjj4eHAS9kjKohmO2PLSTGa+guY0pAJZYnrP/AQAWrnCG6zXZdWupbE+ul2YgqwJgEUcYaCly+P4C5FVJQKAWn1V/skd8YGGhmsn4vqcDGR+sSWnXdZyClcSHGs1miqhcDRNZ52ZYsFlBTJCS5zvaT2ehgoSVDmkj1n2uqJV5erxkaYMQXlKBzmiwAGDRHn/Zqj72pjcSjB7a2cYvf2peN9dUg0YUmObCoZBbjXBtb0nCux7XB4yLoGik6DP5YGbbGSjpFVJdZn7yXnn1iYnSqNkFFZEwriiqutwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by DS7PR11MB7833.namprd11.prod.outlook.com (2603:10b6:8:ea::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May
 2024 23:07:31 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7633.017; Thu, 30 May 2024
 23:07:31 +0000
Message-ID: <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
Date: Thu, 30 May 2024 16:07:29 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	<fenghua.yu@intel.com>, <shuah@kernel.org>
CC: <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
Content-Language: en-US
From: Reinette Chatre <reinette.chatre@intel.com>
In-Reply-To: <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR03CA0357.namprd03.prod.outlook.com
 (2603:10b6:303:dc::32) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|DS7PR11MB7833:EE_
X-MS-Office365-Filtering-Correlation-Id: f84c6022-bd74-4648-9b9b-08dc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f-8?Q?JV0+lm94nnE/eeKqx13rbQHPlVfxg8sjKFdbNc03Z+sM=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d0d4bkFVRERCbFp5RURsWWVJNEdXNkE4NTJMZDJQZ1M4aENSRTJqOFJ4TmJa?=
 =?utf-8?B?VU1uWjcrZmhMejNkNmFrMTBaeU9RQ0hxelNIcTFEdXdYamg3OWJmVk1sK1o1?=
 =?utf-8?B?dVFkanY0TC9QVUpXcW1QanFDMUsxM244Q0lIRE5oeW43K1owVFcwbjNRVXhN?=
 =?utf-8?B?cmRKV1JuVGFxd2lXb2lwUzF5TGpPZGNhV1QxT3o5UExzWVpsS1YyUEZKT3VJ?=
 =?utf-8?B?YXJ1c2k4Unl3d05FSGpHcjVNNHFDUkRLNE5rczhwcGw1eGluMmxFRnJxdlJa?=
 =?utf-8?B?cWx3c3RTS1pZL2ZxeGxWS01TMVdvTXdDM3NYNDZwR2c0TWJmdnQyNFhlOXkx?=
 =?utf-8?B?Zkdzbys0MlM5WXpETUE3U1IzeEdRdGJMejlmRjZOOC9mYVhrL1dhOTVzcm5D?=
 =?utf-8?B?b1N4WC9wSHdrM0lyaFd3My9LTWJzMUJZQUUzL1B4amg3dldOSWlGcFdTU3pl?=
 =?utf-8?B?UVYwQXJiQnJwYlNteE11R0R2MW0vcDNZb2hMU29FQ2krUlBlQk1TZ0E5eXJv?=
 =?utf-8?B?ZXlDeTZ6MVpiZmRJQ2EzU0s1bVIvWmRTbzRkKzdHYVBkOS9nZFpKQ1JZNndj?=
 =?utf-8?B?NTNFVndON05DZzBiY0p0ei91SGU3QmNaMVJvZFkrS2dkW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YzZ3L1NvTnhHSVFRbkhOWWJXeEZldjZiNHAzTVFZSlVydkZLaGFBdXIzd0Zx?=
 =?utf-8?B?VVQ0VVBIZGJ6U2hYc01zZWw2SldtdE84Q3VFdWJRRGxmamNsWDJvY0NmSzl2?=
 =?utf-8?B?Qm9mVnRtUUpuTFFjQ1VSRGtudHk3QWxzbTBxeUltblhETEI4QUZPelNCc0hX?=
 =?utf-8?B?QTJ4NzJuZFV3VEc3S3NiMWUwdXJWRFlZbkZzWkhhbTI4L2l0a2lVT1lCeW0v?=
 =?utf-8?B?NDgzWXFaT3RBSnllc0RFMHIzQ2pwWUw0QVk4MFlXcWNFczdqWGZYR3N0RXEw?=
 =?utf-8?B?bTNEbnB1ZmhMeXUzV2RtOFRBVkM1UU5ZM0t5cGJiaUxSbVNsdzBiaGNMd1lU?=
 =?utf-8?B?QVBVeGhlSFM5cGtQazFMV25ncW1LMnB3SERseTRTUzlpeWNFdGMydDFKVmVj?=
 =?utf-8?B?QU9QUmJQVExST2xpdWxFSFk3dGhGWE4zano2NkxXVXhvbWloSUpsVGxDdGNh?=
 =?utf-8?B?K05kL1pUQmM5RWI5amo2R3NsL3ZLejhsYmMvSmJacUF1ajVjQVFuRlhCU3RD?=
 =?utf-8?B?em9FdmREME9iOVFPem9XL25MaU9QckZEUFVvNTdneEdBblVIcmRkL2UxSmp6?=
 =?utf-8?B?T0NNN3EvUjFKaVNvSTdFRE16Z3BEbXdydk44YWRIZzJFb0RSQ3lJZnVqUVl2?=
 =?utf-8?B?eWc9PQ==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: f84c6022-bd74-4648-9b9b-08dc80fd4873
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 23:07:31.1873
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: RW5vQX8CDMiKD9F2Qe4LvG+ziYrWjo1C+sxNX74SoXz1p0ugrxLP8zdk6JzkunS+D/vOHKx81JWKiGq52Xuh8D/xXbamQVPlHZ0MENuO2oE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7833
X-OriginatorOrg: intel.com

Hi Maciej,

Regarding shortlog: L3 cache size should no longer be adjusted when
SNC is enabled. You mention that the tests are passing when running
with this adjustment ... I think that this may be because the test
now just runs on a smaller portion of the cache?

On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
> Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA
> nodes. Systems may support splitting into either two or four nodes.

fyi ... from the most recent kernel submission 2, 3, or 4 nodes
are possible:
https://lore.kernel.org/lkml/20240528222006.58283-20-tony.luck@intel.com/

> 
> When SNC mode is enabled the effective amount of L3 cache available
> for allocation is divided by the number of nodes per L3.

This was a mistake in original implementation and no longer done.

> 
> Detect which SNC mode is active by comparing the number of CPUs
> that share a cache with CPU0, with the number of CPUs on node0.
> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> Co-developed-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
> ---
>   tools/testing/selftests/resctrl/resctrl.h   |  3 ++
>   tools/testing/selftests/resctrl/resctrlfs.c | 59 +++++++++++++++++++++
>   2 files changed, 62 insertions(+)
> 
> diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
> index 00d51fa7531c..3dd5d6779786 100644
> --- a/tools/testing/selftests/resctrl/resctrl.h
> +++ b/tools/testing/selftests/resctrl/resctrl.h
> @@ -11,6 +11,7 @@
>   #include <signal.h>
>   #include <dirent.h>
>   #include <stdbool.h>
> +#include <ctype.h>
>   #include <sys/stat.h>
>   #include <sys/ioctl.h>
>   #include <sys/mount.h>
> @@ -49,6 +50,7 @@
>   		umount_resctrlfs();		\
>   		exit(EXIT_FAILURE);		\
>   	} while (0)
> +#define MAX_SNC		4
>   
>   /*
>    * user_params:		User supplied parameters
> @@ -131,6 +133,7 @@ extern pid_t bm_pid, ppid;
>   
>   extern char llc_occup_path[1024];
>   
> +int snc_ways(void);
>   int get_vendor(void);
>   bool check_resctrlfs_support(void);
>   int filter_dmesg(void);
> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
> index 1cade75176eb..e4d3624a8817 100644
> --- a/tools/testing/selftests/resctrl/resctrlfs.c
> +++ b/tools/testing/selftests/resctrl/resctrlfs.c
> @@ -156,6 +156,63 @@ int get_domain_id(const char *resource, int cpu_no, int *domain_id)
>   	return 0;
>   }
>   
> +/*
> + * Count number of CPUs in a /sys bit map
> + */
> +static unsigned int count_sys_bitmap_bits(char *name)
> +{
> +	FILE *fp = fopen(name, "r");
> +	int count = 0, c;
> +
> +	if (!fp)
> +		return 0;
> +
> +	while ((c = fgetc(fp)) != EOF) {
> +		if (!isxdigit(c))
> +			continue;
> +		switch (c) {
> +		case 'f':
> +			count++;
> +		case '7': case 'b': case 'd': case 'e':
> +			count++;
> +		case '3': case '5': case '6': case '9': case 'a': case 'c':
> +			count++;
> +		case '1': case '2': case '4': case '8':
> +			count++;
> +		}
> +	}
> +	fclose(fp);
> +
> +	return count;
> +}
> +
> +/*
> + * Detect SNC by comparing #CPUs in node0 with #CPUs sharing LLC with CPU0.
> + * If some CPUs are offline the numbers may not be exact multiples of each
> + * other. Any offline CPUs on node0 will be also gone from shared_cpu_map of
> + * CPU0 but offline CPUs from other nodes will only make the cache_cpus value
> + * lower. Still try to get the ratio right by preventing the second possibility.
> + */
> +int snc_ways(void)

"ways" have a specific meaning in cache terminology. Perhaps rather something
like "snc_nodes_per_cache()" or even copy the kernel's (which is still WIP though)
snc_nodes_per_l3_cache()

> +{
> +	int node_cpus, cache_cpus, i;
> +
> +	node_cpus = count_sys_bitmap_bits("/sys/devices/system/node/node0/cpumap");
> +	cache_cpus = count_sys_bitmap_bits("/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_map");
> +
> +	if (!node_cpus || !cache_cpus) {
> +		fprintf(stderr, "Warning could not determine Sub-NUMA Cluster mode\n");

The tests just use "ksft_print_msg()" for error messages. The "Warning could ..."
is somewhat unexpected, perhaps just "Could not determine ..." or "Warning: Could not ..."?

> +		return 1;
> +	}
> +
> +	for (i = 1; i <= MAX_SNC ; i++) {
> +		if (i * node_cpus >= cache_cpus)
> +			return i;
> +	}

This is not obvious to me. From the function comments this seems to address the
scenarios when CPUs from other nodes are offline. It is not clear to me how
this loop addresses this. For example, let's say there are four SNC nodes
associated with a cache and only the node0 CPUs are online. The above would
detect this as "1", not "4", if I read this right?

I wonder if it may not be easier to just follow what the kernel does
(in the new version).
User space can learn the number of online and present CPUs from
/sys/devices/system/cpu/online and /sys/devices/system/cpu/present
respectively. A simple string compare of the contents can be used to
determine if they are identical and a warning can be printed if they are not.
With a warning when accurate detection cannot be done the simple
check will do.

Could you please add an informational message indicating how many SNC nodes
were indeed detected?

> +
> +	return 1;
> +}
> +
>   /*
>    * get_cache_size - Get cache size for a specified CPU
>    * @cpu_no:	CPU number
> @@ -211,6 +268,8 @@ int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size
>   			break;
>   	}
>   
> +	if (cache_num == 3)
> +		*cache_size /= snc_ways();
>   	return 0;
>   }
>   

I think this can be dropped.

Reinette

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 C9624186282;
	Thu, 30 May 2024 23:07:40 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.13
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717110463; cv=fail; b=FVVNezKcd4h1e605yb6dF6uQQXLaeDAFtCnvkAkKx1HuwdZzY+UfvXxWFAMwwLCNLVAfLJgoyhjm+1+TLPLWXjuXRoAyE/L2rkwVAA8TDnFLot3ALU/94kNO4WQcs8aed1GNb833GtMHBh3P8zY67MKFj0X8FMO7SpkQkjI8SxU=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717110463; c=relaxed/simple;
	bh=6V6jSMBj9iiCHKoaDBTBw5hFxk6BhpXaUdgEXeflLcI=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=O7SSGtz7txYaMFljE4CN71k5xYDxFAcTlW6mEV1DnnCSKz8RqxhKbZZG73ztsQGo+p6ktDtyF1kPOwO7i/cr4gibXACwKw7P4uju++PIqK18ruL8Kw5FbcgT443enm6HVV1yipw+mLliANf12DlePfUEevXFfOCMHnArW+snOZc=
ARC-Authentication-Results:i=2; 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=hnuFAnx2; arc=fail smtp.client-ip=192.198.163.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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hnuFAnx2"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717110462; x=1748646462;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=6V6jSMBj9iiCHKoaDBTBw5hFxk6BhpXaUdgEXeflLcI=;
  b=hnuFAnx21BNwfR5CAFnua9r+QycxySZymeXnKcmADc/lBh5a2+PPyK1+
   RW2wdUYdGom6Q9pzLGJM8/cXpk88HVtGJSRZG/DCaoAyeOaHzT3q+NFem
   lPApJLid1YIhtz5CqoGEhRoTgdOr2MSV7rGP4vLKl7ZU1hDggWjvVjcP/
   RAzBncJS2nGSmWfdI/pXT9Sg5fcuYn1EM7Gu/7MIwoxqU8LCK2r+wvRRA
   OS7oSfIv9JfGR8VBebK1YBDSgExOvh0iaXeQr0n8BcncHwyPEr/B94OKs
   j9JydAALTYsmL9gS62J4Y9QIgusDfH5vqL16g2+XTP3eMv2tYe2xIL+ng
   A==;
X-CSE-ConnectionGUID: K5WpYo5kTTK2x9OVzgy9RA==
X-CSE-MsgGUID: C9nqFLE+RMy0CeZ7AA6rbA==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="16584032"
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="16584032"
Received: from fmviesa007.fm.intel.com ([10.60.135.147])
  by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 16:07:40 -0700
X-CSE-ConnectionGUID: xjQiL0gaS1GidpSYgxM0rg==
X-CSE-MsgGUID: PlGArqMJQPqTEaU3ndL/kg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="35904945"
Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16])
  by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 16:07:40 -0700
Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by
 ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 16:07:39 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 16:07:39 -0700
Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 16:07:38 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=kCygKoiDItgS7c7Q8tY+ONt6VAGPkmPt5of0z0trAc4jze5ioOcEEBYnbBl7OVOuAtVmvOdwYEAz0T6ec3ZSM/Xk/G2beRXrPFzhqhb478W2P90KkgTKs5cUOaorAX8AjmSXKxPSvHd0yrCzUd4CQGmlpp3vWBjQskmU45E1oPj6wKgtpbuuzYhnR2TPDuP6/Vek1nrQ1pug/e1CCwvQTJ2+qIbRioNobLW1UQI507svzUaToyuHGN46u16fI/degaRhxsZaWo9uQ21dpxwp3x209fzwX0Ezfsj7touKfEPli/aDP8C9SQWqQLteYs2UOpQDF9i40eJ5UN8ndlvt8Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3H5/XPxRRkSjNAU2Hi7CYMJ3vxEZlBGsJ4wSensHOJg=;
 b=e4+fSKJ2ccDbho7OR8oSO0/ygQ8fIvc4e0hKR+ZscyGiCkIZ4hR1AXyxRR4Y0XsBK+KedUHfHo7+OtvBPhVlJVpZ/2gzU4JbxBHMyORc0xE8FZUd4nJhYaKJCRNhZMIP0osEBm5soPPqD3IZ0uLn2wErioK5NPrJ+NmfwUowxG52cmEnAeVqvcdUKBRin5LCxP+bwjuz42m7r6YrWe6vpSNVHBgo6myJlaeBmoJA29KM9uk654NBUQLuddi4RdvhJfl1XTFmCuSuc7FEqeuuvZNzUsCdllvnhRPLOkurTvpvzxILxO4XUCgpwlUKoSUzc+TVe5FAjOC9rLzWtm5rfg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by DS7PR11MB7833.namprd11.prod.outlook.com (2603:10b6:8:ea::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Thu, 30 May
 2024 23:07:35 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7633.017; Thu, 30 May 2024
 23:07:35 +0000
Message-ID: <d8396d97-5000-4ffb-aaba-e71de5d6d909@intel.com>
Date: Thu, 30 May 2024 16:07:34 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] selftests/resctrl: Adjust SNC support messages
To: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>,
	<fenghua.yu@intel.com>, <shuah@kernel.org>
CC: <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <16764746e8f9f42cbd45d61210764a9b67085cbf.1715769576.git.maciej.wieczor-retman@intel.com>
From: Reinette Chatre <reinette.chatre@intel.com>
Content-Language: en-US
In-Reply-To: <16764746e8f9f42cbd45d61210764a9b67085cbf.1715769576.git.maciej.wieczor-retman@intel.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR03CA0357.namprd03.prod.outlook.com
 (2603:10b6:303:dc::32) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|DS7PR11MB7833:EE_
X-MS-Office365-Filtering-Correlation-Id: 2bd6609e-5015-4bf7-7861-08dc80fd4b05
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015;
X-Microsoft-Antispam-Message-Info: =?utf-8?B?N0JmSTBwMUtvRFU1bFFHZ3Z2VHY2MXRVWm1WdUJsclQwa1ExYVpldjJjbngr?=
 =?utf-8?B?NFJOMkVhcktEc2Y1ckhJQzRVVWFxWDQzSkxkblVXSk0wa3VlMGxqSHJoZVFQ?=
 =?utf-8?B?b2p4d2xMUnJlWmJmYmhmU3lacnRIdVBHMXA5ZHg3L3UwZmtrT0pwekp5Ti9k?=
 =?utf-8?B?dlhFN3BSL24zaWNVa3pvS0JZeWxNQjF5TDJBUC9wL1laMGVkWktwVDFGU3hK?=
 =?utf-8?B?eW1GNyt0MDF3ZGNxY2VDNjhIZUNleS8zV3U4Z255ZjRoNXZOQzd5NERvZ0M2?=
 =?utf-8?B?aXBRMlVpOVkzVmM2c0JXTGlGMkVmZmUybTZySVd3d25xYmdqeC83b3pnd0Z0?=
 =?utf-8?B?ZEZOWlhVRkQzZD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2RzlaRURjSDJ2N00zMzdzRldt?=
 =?utf-8?B?emVGTTNzVzlwNmdhTHdmN1Axa1puOUYvQmlWU0lvVGFxdlB1MFFtVHZuTGZa?=
 =?utf-8?B?ZVRhU0lkWjN4WUtOcDUvdXF2N3kwMGZNME8zZ0JlbDFhQVVwUDhMV2U5dHFr?=
 =?utf-8?B?QjVpcnJnV014eWFVM2t0all2VUtHTHhvN2x0elZpMTVQY2M5L1Vka3ZWZHBp?=
 =?utf-8?B?d2lGcStteHA1cFJ6bDdQWlF1TkdWRVJmTW1maFBlM2VuYit5SUd0RVFyRk9y?=
 =?utf-8?B?TGRCemw2SXBSeEdNRW1DbHNTVTBXNFNkMTYyNWFEU2creTh4MDArVlV5ZC9J?=
 =?utf-8?B?RE94OUNIdGlFNXc0ZG5IcWprTkg3QTBWdGZZNnAwZldEalJsYkFSenRjYUx0?=
 =?utf-8?Q?CPF2iTBvDFKcDMADyBl1r7Fz+Mp0HNoD3iXhopS3vozw=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SGpYdWFDVldpMG95anFocjFYVFFVeUE3TTRkZ2hDS3NLOGhoSldkcldGTStm?=
 =?utf-8?B?ZEFXVEdzbjdXKzlYbkhoYjdDWFVJZHpjdU9oak5ES21VQnN5bG8xUks5alJs?=
 =?utf-8?B?aHUyeWltK1ZiY2F4a3ZlTHIxKzFnS2hIT0xnME5ZbUE1NDQxTFdrN0dya3lC?=
 =?utf-8?B?UkIxT0NETG52RHAva1Z4a0FERnN1bEJxN3RZakhENU04bzZ0STFXemI3OWpv?=
 =?utf-8?B?NVdtWENkUEVuLzFKSlhkZzVSbWM1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VKdEszUXJoNGszMG9pQzd5UzFj?=
 =?utf-8?B?TkJqNUYzbWMyQVp0anVJN0RiVkFORUtwVHhveTRzc2RYZFQ2MXZodXRqdmox?=
 =?utf-8?B?bW5EU3BhMEdDZVk0UHRzaFl2NFZYMEp2VU5iMUExZnA3UGtTT1M0ZHNPRk55?=
 =?utf-8?B?cVE9PQ==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: 2bd6609e-5015-4bf7-7861-08dc80fd4b05
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 23:07:35.5352
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: k9xyWej88MvWheBmD/IOeyvQ8iixwkCyUjmb6c+xYG/qko+OVYTVrsnsrJ5VXBZDXFBBvEKaHFJNjtrQuSYFnTwYnJKhgi0Zk+lrGWhHrP0=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7833
X-OriginatorOrg: intel.com

Hi Maciej,

On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
> Resctrl selftest prints a message on test failure that Sub-Numa
> Clustering (SNC) could be enabled and points the user to check theirs BIOS
> settings. No actual check is performed before printing that message so
> it is not very accurate in pinpointing a problem.
> 
> Figuring out if SNC is enabled is only one part of the problem, the
> other being whether the kernel supports it. As there is no easy
> interface that simply states SNC support in the kernel one can find that
> information by comparing L3 cache sizes from different sources. Cache
> size reported by /sys/devices/system/node/node0/cpu0/cache/index3/size
> will always show the full cache size even if it's split by enabled SNC.
> On the other hand /sys/fs/resctrl/size has information about L3 size,
> that with kernel support is adjusted for enabled SNC.
> 
> Add a function to find a cache size from /sys/fs/resctrl/size since
> finding that information from the other source is already implemented.
> 
> Add a function that compares the two cache sizes and use it to make the
> SNC support message more meaningful.

Please note that the new version of SNC kernel support ([1]) that this
series is based on no longer adjusts the cache size. Detecting kernel support
for SNC (if the new solution is accepted) can be done with the test for the
existence of the files Tony mentioned in [2].

> 
> Add the SNC support message just after MBA's check_results() since MBA
> shares code with MBM and also can suffer from enabled SNC if there is no
> support in the kernel.
> 
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
> ---

Reinette

[1] https://lore.kernel.org/all/20240503203325.21512-1-tony.luck@intel.com/
[2] https://lore.kernel.org/lkml/SJ1PR11MB6083320F30DBCBB59574F0BDFCEC2@SJ1PR11MB6083.namprd11.prod.outlook.com/


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11])
	(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 ED13617B418;
	Thu, 30 May 2024 23:46:23 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.11
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717112786; cv=fail; b=MkdhYMXbBdDaFhKoMERGtbbRzswcYXh3I9fB9i3IWtZZKGYZNkhLSfuyqMdlWjrwa/LjWckQs9w8UkIYiC4uGSMkJuSdp7lfoV1vqgCziOX6SYZzG6GXLWdVDDN3hrg1BFfOccx/iI5VtfgZdyPvXo5RKK3kT+UBuXhCT2UprUI=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717112786; c=relaxed/simple;
	bh=C1bcsetXCaq4RWTvr+tgh4tYUCbX0jGBvFffvHyaVP0=;
	h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:
	 Content-Type:MIME-Version; b=dG3udiM0+pg7SQYWmGRynZG+pTy/fuyvF2/q/PvGN24PS1Lu61A5/GqsetO2ncburZdrn23dZ3hbUsm/t6z7A/vSXTTaP3bMdngzbsP9GQbcXc1A8Cs7xDJFdyf9YplpcYUiKG0bqDPcppkmrec8NT+8eTEShieob2e76/rFXUM=
ARC-Authentication-Results:i=2; 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=FgivVOLx; arc=fail smtp.client-ip=198.175.65.11
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FgivVOLx"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717112785; x=1748648785;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=C1bcsetXCaq4RWTvr+tgh4tYUCbX0jGBvFffvHyaVP0=;
  b=FgivVOLx3vEFWAMRwnmZ7mVGGAkxZAdwPFftvmvbc5jpYa4hWJSNWfSf
   FH35+WaEa1TWnwOCQlpYQKlD60LFS/GUaQbXnDm8W88kEgEiCcma2a0Pm
   fin5pHtLMHDIXqV31aFmOrQRza/JkpuSj6kkUt7vX2zhtG9vGT9uPelvi
   0OmUtERpXQYdqboRlVcqLi34yvNIVeiUARQGQ/fXmpKbI+gnXUUi9A53z
   uCwKojhHZ8zUBqkB1vVcKk6/TqU74UPr+dStLB9FjwzF1LvwMAdndqR/+
   QiTCBwj8N8laCywUg9h7wUDrelzYwcUQtzRxkQ/Sjt9ojaQQZBJR7SwiW
   A==;
X-CSE-ConnectionGUID: CIxRNOT5SPSro/EhkV3SBw==
X-CSE-MsgGUID: asWuibuuSM+fcy2vImE15A==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="24200013"
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="24200013"
Received: from fmviesa002.fm.intel.com ([10.60.135.142])
  by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 16:46:23 -0700
X-CSE-ConnectionGUID: 7EH+Uc1aR3mgnrCr6j4O1w==
X-CSE-MsgGUID: Vmeq9RAgTFOzrqnhQeTk2g==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="59162717"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
  by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 16:46:23 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 16:46:22 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 16:46:22 -0700
Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100)
 by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 16:46:22 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=DF25tjwfrPN5n5slRcnDuJnlY4m+CYYUgU7jvUwVwlZpgOPnPDHXdHbGhw7TZvcj6JSMwMil/Djwb0/dlRWpScRaBWRRLddGksdNflvn5a9uapOfKrbTgKT3m+dMLpbhDf6sqmq9a3fWISUmv87eNZ1wj/I6UDHy3K/MTPFLBbYXHJD775kCULk0gdQ472f2BkV7sRueaPCLPQsVju/x2MWKjFelGgJ/K/WGlmJg0YABNJaIzY2J4MfWj/imL3VQUF2QQWhU7ONSiG9dMdfHBKSdnCZW6RopEOCyVhqm3ZDjwdVWVD3Mj6NLmxFt2LJh1ozWCp0cZ5ynR63m7sYVJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=C1bcsetXCaq4RWTvr+tgh4tYUCbX0jGBvFffvHyaVP0=;
 b=Im0KQfJKjBkfXxLil7cpbR6ZBLMhTMqDW2cny/VkAXJwQ0HUDPU3Mb+LOgFieR4Oy3F48oFgd7Moaqalg6B7uu39cJhPfe3/pQnvcovbRxDW6NfMgyuUt/sx6yRdFx2RzKDlIj7zbqZeGpyYG2gShLXbGCQHQPFFMe0pHUteYI667HhOOhBzciHI34fBjB6CxQSy1U1cEipklZwC7qdXBFa9lisFY3Ko3Us1ChF/vxzwm7kNy3n2BczE6LByLlolcgpgc8XhULzWVp1wLM+pAyyiTH/ZdNjVLDrGmgjfW6GlO9pPYPgsttYzvxHhKeDs1LlqLQ8p0hoR9971R4OmRQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com (2603:10b6:a03:48a::9)
 by PH7PR11MB8009.namprd11.prod.outlook.com (2603:10b6:510:248::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Thu, 30 May
 2024 23:46:18 +0000
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361]) by SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361%5]) with mapi id 15.20.7633.018; Thu, 30 May 2024
 23:46:18 +0000
From: "Luck, Tony" <tony.luck@intel.com>
To: "Chatre, Reinette" <reinette.chatre@intel.com>, "Wieczor-Retman, Maciej"
	<maciej.wieczor-retman@intel.com>, "Yu, Fenghua" <fenghua.yu@intel.com>,
	"shuah@kernel.org" <shuah@kernel.org>
CC: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
Subject: RE: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Topic: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Index: AQHaprmme8fjFWvJ30CJk2uljzCiTbGwftaAgAAI17A=
Date: Thu, 30 May 2024 23:46:18 +0000
Message-ID: <SJ1PR11MB60833CF8BD209555A5370299FCF32@SJ1PR11MB6083.namprd11.prod.outlook.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
In-Reply-To: <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ1PR11MB6083:EE_|PH7PR11MB8009:EE_
x-ms-office365-filtering-correlation-id: 7c06448c-ee97-440d-b6bd-08dc8102b39c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230031|366007|376005|1800799015|38070700009;
x-microsoft-antispam-message-info: =?utf-8?B?OW9CWm5jZE5BUUxIc3JIMjY4bklmSHJRY1ZxWWxHanJxTzNyS0dPdUhEUEIw?=
 =?utf-8?B?OTRWVFJKdWV1NGZsVG5QSk0rd1pSdXIxWFBCS0RWdFJyeE93SjB6Sm5WZU8w?=
 =?utf-8?B?V3lTMHBEOTE2YWZkcHEwbXhDdlRPMlFjOE40SnZnc0RydThXQ2xxSktpbURH?=
 =?utf-8?B?c1MyME1UMStmVVl5WGRPdHZlaVpDTlZ0b1U2SkdBL2tkOGdCZGxpNnhmNjRs?=
 =?utf-8?B?NS9YdUgrb2M3WlJTV3pqbEZOMGJPWGlvSzFjdjlxK2pyTE16S2VKWWJoSG4y?=
 =?utf-8?B?MXVHVU9wVm4vZ3BlUjJIeDlQY1AwcllxQ1J3K1hIR0xtRVlkdGxmVzVjTFFj?=
 =?utf-8?B?bjU2NXJOL0s4bHh5M3JaM2hsemI1TkdVeExNZWIya0FpQlV0a3hheWxicjU0?=
 =?utf-8?B?SDBYLy9tZ3B3YjQ1T2djejk5bGhxN1gwRzJaOWxXYURtU0dkWlc4NDJGSDdk?=
 =?utf-8?B?RDJ1MHdXeisvSG9EL2tvZUpsL0tDK2l2aXpvSklvU3BTenFBRjlRR1R5bkoy?=
 =?utf-8?B?UHlNSHcwVUZ6U0ZzU2huU20yNUt3S01MTUR6aUFSdWgyVCtCV3FMYjNvVHNE?=
 =?utf-8?B?MjNvZzdEd2RzSkZwb3FwRjZpcXBjMnVGYmZtU1o4M1kzVlFJM2pCZFVuWU5U?=
 =?utf-8?B?WVBEZmRJUVZZVUtmeDVJWFA0MmlLK3EwMEhFMGQxZFJSeFFhcGRkU01TTC8y?=
 =?utf-8?B?WnlwWjZqRCtzdi9Ha3NCRXNtcElaTWxWcW9Ebnk2Ly9YdkxXOGszSFRJVmd6?=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EVLb1VDYis4eUwwWHpTN0xFTWQzQzVRRmh2dXdtaUVPQXEvQ0t2?=
 =?utf-8?B?cmwrQXJKc29ncUViWmdwdUxnY2c2R0NIZGVHRWx5N2ZEQm5kcXhkT25YdWdX?=
 =?utf-8?B?L3dhTGxCcjZJY2xVa2hpSWNnZEFRKytqZUEwREc5WWxBZjFqSTRqeHVnZzRy?=
 =?utf-8?B?b21qN3hTRmxoSmMyQU5vUT09?=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ1PR11MB6083.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?R3gyZGQyZ04xSDlJbHVJMzE1aWFhVU1WSlEyekZJQTIyb2lOdHFJSEM4RGd0?=
 =?utf-8?B?Sm4rbVBOdVlTWFA0SjJFTWUvaFdmMVVZLyt2dGo5VG5xQnlCOUpoT1ZoYjA2?=
 =?utf-8?B?MFIwRVVzK2wvRmFLZDZYc2NaOTNHaFFXTnZRR1FRQlN4NnRsQ2NkNjVsbTdD?=
 =?utf-8?B?QjRqL0hzYzRtL2lkMWFYeGtmRXF3TWswUUlnaXU1TjNqQWNnTmlEL2ZGYjZN?=
 =?utf-8?B?UG1GbG9JZkJDS1ZWMGk5R290UFNnSjMvTWtTamNxOXpOSHFGcE50UVBlQWV1?=
 =?utf-8?B?ZEdwT2NOK2tpdlV6cUF4Wjc0T1QyY3drck9jUVZaVG1KVWN3aGlneWY4d3JH?=
 =?utf-8?B?b2lVc0VKU2lTSXhqZ2Uxdm14SFhhakhjVEk2L3JBc3VoQklRNXl3dUh2bkc3?=
 =?utf-8?B?ZmU3NXJVN2kxUDBBQkRpeE5QalF2ZVVhRENuSzEyV3RnZktKWmhHWm51ZUpH?=
 =?utf-8?B?TDZEYkI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S2d1VTNmRDFmQ2N0?=
 =?utf-8?B?ZkVoOG9TU0s5N3VuK2tZam1QTVJia0ZSMGNId3VVQUVVcjdjWE5uQVg0Mm5P?=
 =?utf-8?B?NVJ4N2FwUDF5dGcrd216N0FuWllaVFl4TGE3NXh5QTVKc2RreUQ0ODN4VGc3?=
 =?utf-8?B?M0RId3pqdnB4dGFHMDNvcHJ0MlZMK1pCeCtJNDU4amprSTNzNzE2dG5Zb1BK?=
 =?utf-8?B?QVBlQ2lGWDdEczNMNnBpT3o4QmZxQlNJejFlQ1d2M3ZkcmlHWTJSdUJaK2Qy?=
 =?utf-8?B?Q2gzSW5melM2VWNsVmhjbmlVOTJrMVhETS9kV0ZEYk96RkRkZXVWQytyb1o4?=
 =?utf-8?B?Ry94MTYwTGhqYnJBeDZKYVhWK2Z5MWo0L2Zyd1dienNDMnlpcTVqTmdNbzFm?=
 =?utf-8?B?KytpdnJydWlCb2RuaG1Vd2l2SUJnOHdmNHltQjRYcTkrZzB3STF1TG5JZU9U?=
 =?utf-8?B?eTFHYXI5VFE4WC9wN3NjaXRWL0tEelR4c1FEckhHeERlV2Y4RGJ1ZlZTTzJp?=
 =?utf-8?B?RkROdDJRWHJkMUNNcS83eHNjVkg2dmxoVzBtMHlQb3Y5R1B2aDFNOXZEemkr?=
 =?utf-8?B?dGdrNDIwSlpUYzZMdWdLYTJHSEEyaHdxeVpaSG5PSmdMQmwzL2pLSThseTB6?=
 =?utf-8?B?Y1h2SUUxYklLZ0lGRjZYM2lreS9Gc3NnaEI1MTlScERjdEo5OFZpT3lDdmQ4?=
 =?utf-8?B?UnhiVmcvQ1huck80eElpK0g3YkFHZU0rb3FOTE9IYXpNSzdvdGRUaGU5MHpa?=
 =?utf-8?Q?7Hp7T1PNX/C/0xg0HUxFPP65y?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6083.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7c06448c-ee97-440d-b6bd-08dc8102b39c
X-MS-Exchange-CrossTenant-originalarrivaltime: 30 May 2024 23:46:18.2564
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 6gWQSyDF5uXw8TLqgpRewg947OC596TQsIwLoBadzd776skzAdHOwXSlxl5WzDBFYeA0EuJ+s4lNk7CM6l33mg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8009
X-OriginatorOrg: intel.com

Pj4gV2hlbiBTTkMgbW9kZSBpcyBlbmFibGVkIHRoZSBlZmZlY3RpdmUgYW1vdW50IG9mIEwzIGNh
Y2hlIGF2YWlsYWJsZQ0KPj4gZm9yIGFsbG9jYXRpb24gaXMgZGl2aWRlZCBieSB0aGUgbnVtYmVy
IG9mIG5vZGVzIHBlciBMMy4NCj4NCj4gVGhpcyB3YXMgYSBtaXN0YWtlIGluIG9yaWdpbmFsIGlt
cGxlbWVudGF0aW9uIGFuZCBubyBsb25nZXIgZG9uZS4NCg0KTXkgb3JpZ2luYWwga2VybmVsIGNv
ZGUgYWRqdXN0ZWQgdmFsdWUgcmVwb3J0ZWQgaW4gdGhlICJzaXplIiBmaWxlIGluIHJlc2N0cmwu
DQpUaGF0J3Mgbm8gbG9uZ2VyIGRvbmUgYmVjYXVzZSB0aGUgZWZmZWN0aXZlIHNpemUgZGVwZW5k
cyBvbiBob3cgYXBwbGljYXRpb25zDQphcmUgYWxsb2NhdGluZyBhbmQgdXNpbmcgbWVtb3J5LiBT
aW5jZSB0aGUga2VybmVsIGNhbid0IGtub3cgdGhhdCwgaXQNCnNlZW1lZCBiZXN0IHRvIGp1c3Qg
cmVwb3J0IHRoZSB0b3RhbCBzaXplIG9mIHRoZSBjYWNoZS4NCg0KQnV0IEkgdGhpbmsgdGhlIHJl
c2N0cmwgdGVzdHMgc3RpbGwgbmVlZCB0byB0YWtlIHRoaXMgaW50byBhY2NvdW50IHdoZW4gcnVu
bmluZw0KbGxjX29jY3VwYW5jeSB0ZXN0cy4NCg0KRS5nLiBvbiBhIDItd2F5IFNOQyBzeXN0ZW0g
d2l0aCBhIDEwME1CIEwzIGNhY2hlIGEgdGVzdCB0aGF0IGFsbG9jYXRlcw0KbWVtb3J5IGZyb20g
aXRzIGxvY2FsIFNOQyBub2RlIChkZWZhdWx0IGJlaGF2aW9yIHdpdGhvdXQgdXNpbmcgbGlibnVt
YSkNCndpbGwgb25seSBzZWUgNTAgTUIgbGxjX29jY3VwYW5jeSB3aXRoIGEgZnVsbHkgcG9wdWxh
dGVkIEwzIG1hc2sgaW4gdGhlDQpzY2hlbWF0YSBmaWxlLg0KDQotVG9ueQ0K

From mboxrd@z Thu Jan  1 00:00:00 1970
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 C8548186298;
	Thu, 30 May 2024 23:51:43 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.21
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717113105; cv=fail; b=jUsqG/BjFUgvKuwqbEgB3zh1up+u/Q+d/PKVQP+pCm4QlB7aHPve3paAd7kalZCkZMJhe7dNBpPoD/Y8+YAF+OwiaXoCPSAK8kOW01E2XrRImjxR6cO8rCZN6+j+aNygJJcMMNpG2HGulOlAKina/v1s5atQqHJQHTltUdTNtU8=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717113105; c=relaxed/simple;
	bh=h46yNoclT35tHRodqizVjNlSYadc4hoVDGjRuQ61Pmc=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=WxbM9gRLAv4d4IgGQ22Luci1aMM9whXwRUEX3GLhgnipIRk1PPGQspZmFOpSIlDcBHZ6QEF/9SQSyimkZFqKyYu7bhdYT+yxZoBqG7l80Nanz83dI08QXlsuJxbRCRZQZlVKVRUo1STtDxzBndbmf1oE4ojloqW9+RG9QgDzOIk=
ARC-Authentication-Results:i=2; 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=T21rF4wE; arc=fail 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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T21rF4wE"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717113104; x=1748649104;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=h46yNoclT35tHRodqizVjNlSYadc4hoVDGjRuQ61Pmc=;
  b=T21rF4wE+GABTQQpyZGr96GXtdAuGBROSFlVYPiQ1qYIBbyQEwKu8gzx
   Rj6Sq22pO7UKUg/U87Ncl1EZ7B5hgsIwdLQGHKRiiHubwmo28cJ6pEC2J
   TVJPyOOjyvJ51j7+A7N2PJHfQInAZCI5Bj6wqSdfrln9F6F+lyAzVMkNn
   JbLzwIkJCmJ7l9sqEtHUH6ZPVjSZ1+EnRM0hUN6qVRuQhnOZqRC5WbCgc
   05fks5JZlHpNe9PW8kfxdujofyH62W/BZcJXVvBCzDZgajW6rHx9kEXi2
   1BOywPdUf/WO1Agr7CxDpWAkd06jEGAyQtBy48Mlg61W510OgK1tdgCXD
   A==;
X-CSE-ConnectionGUID: r5I/QhsQSQe12nNO7J+47w==
X-CSE-MsgGUID: 8wxgD2M2RUGX7t5vcYmjZA==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="13595434"
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="13595434"
Received: from orviesa007.jf.intel.com ([10.64.159.147])
  by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 16:51:44 -0700
X-CSE-ConnectionGUID: Ojpj58KdQb+8cM+ITXIV2w==
X-CSE-MsgGUID: n71JmIN1Roqd9oO29dRsMA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="36604013"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
  by orviesa007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 16:51:43 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 16:51:42 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 16:51:42 -0700
Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100)
 by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 16:51:42 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=GPiLjYH9bXgf2gfjMlxJFYH8Gw9lwT3DiR1Sy9hCJS9VPY9IQ3l58H4Yt7aTEc2Bpp4cd3vKF2TwaEVLDuHvhk/SgKZrRbD67CntKeYacb2mT8TB7bgaIfmr9xgG4J/26kK+m75plFssV6BpbmMblqWGxQnVd9JqWKfRjrRIc8h+lxOKK/C9mv3CdX0zwXzL91OFQHN9YVgn/7YGoj60D4ydWR0TJw6VY5700qVDSS/N4YwX93kDf6NVwgHC2y2uL0ilU5fMgwL8UiYYmBMmdvzCupS1rSgXT37e/R2UVpOdIt2DWozTj6cr6KVDPGtMbSOSJe0NKSN2kXlKUU53oA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uWGgY/6iaDQ3p5NgNgb3yLntYkwWpQZE78S/l+9Zjvs=;
 b=AIo2nL+U0FGx9uuNcPVoJ6m4PTe1Ttt6V7sufMVVhkZTeD+2MrDa+HbMzUInJayWojQtA1jNYLeP+D5MPYpbxwDKuztUAgl78Kp3cBohLemHTbKM0chUWZkFRO/BqjJZ+8Tz1XBJcQj/F7dem2RWhqqEB0sy1QM5+cgticbFl8FCLnNzQqwsn9weVpz1HV7rhGGPC9QjW7EblhCMLMSpt/p//nrtVSeEjB7vVaI36R9VbCPGftL8QiQu5nsVnqwYd8TORTkRlJavfM+EJYdTN+wUFFNn4I3z+lHMlALCdcg+nEJw8uk2HN3w0qBXC5cy5BSQXul3csWUxIhGicpcDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by SJ2PR11MB8498.namprd11.prod.outlook.com (2603:10b6:a03:56f::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Thu, 30 May
 2024 23:51:35 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7633.017; Thu, 30 May 2024
 23:51:35 +0000
Message-ID: <992cd5db-1cc8-4238-879b-8ef0406edc33@intel.com>
Date: Thu, 30 May 2024 16:51:33 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: "Luck, Tony" <tony.luck@intel.com>, "Wieczor-Retman, Maciej"
	<maciej.wieczor-retman@intel.com>, "Yu, Fenghua" <fenghua.yu@intel.com>,
	"shuah@kernel.org" <shuah@kernel.org>
CC: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <SJ1PR11MB60833CF8BD209555A5370299FCF32@SJ1PR11MB6083.namprd11.prod.outlook.com>
Content-Language: en-US
From: Reinette Chatre <reinette.chatre@intel.com>
In-Reply-To: <SJ1PR11MB60833CF8BD209555A5370299FCF32@SJ1PR11MB6083.namprd11.prod.outlook.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR04CA0290.namprd04.prod.outlook.com
 (2603:10b6:303:89::25) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|SJ2PR11MB8498:EE_
X-MS-Office365-Filtering-Correlation-Id: 74e4629d-8ed7-45a5-bef3-08dc81037056
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007;
X-Microsoft-Antispam-Message-Info: =?utf-8?B?emRuektCcm9uS3ErYkplb0t1SGtpZFdaK0d4Q0NaKzE4a05tN2g0NEpFZ3Bl?=
 =?utf-8?B?ZE5XUVRKWUdnUllYM0x6d1Y2cmZaTk1EWExVUSthaWgzS1VtdkhvTGhVUVBH?=
 =?utf-8?B?SXFCRW51aGpyL0dsdVkwMVZEME5SWXY0RGUyT2JDdDB3OFk2b0t0RGdwRE9P?=
 =?utf-8?B?ZHBYZjFncGZzVk9ZZW5mM05lb21XeXFLU1JtaU9SZHpHMmhmKzdEcEVFMDR0?=
 =?utf-8?B?aGZ5REVuRmY2dERRQkNvUnc1QXNHWE02U0xKLzI2azRweW4rdzRGTzU2a3Fm?=
 =?utf-8?B?VFZmK3h3Q3JyRmtpUmpnaWloS1l2amNRdlREVE02cTB2eGtyWklBTGVGdnNa?=
 =?utf-8?B?RHBKYi93bXJwVHVPUjc4eU1CaTByU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0s5TGxKVmgr?=
 =?utf-8?B?YnY5bU90NkU5YWFHVUJuQjBXZlFETno1YW5CMXBrMHB5ZmhCOXZLL2g1Z0hq?=
 =?utf-8?B?bjNHR0xGWjViZENvbERaLytYcUhycFlhRFM0amYvbFVDNWloRFIzcSswUWV6?=
 =?utf-8?B?MUlMWUdnUUdqT3U5Zm1LYUliTmxvN2xHTkc2dGxETmRXMXY3aDZDeEgzUmNQ?=
 =?utf-8?B?dktsUGhWZmlNN0wrRkg5c083dCtCcVBFVU9HUnV4eXNnZnBwU2hBTFdwakIy?=
 =?utf-8?B?dUVPUElBSTRyQW9UWmxPQlVkTVpoK1lJSXVxQklrZ3FxRzVGbkpSRnR5VW1Z?=
 =?utf-8?B?VmJuVDVOVzU1azk5QS82eGdMeXg2b3h3WlArTmNSWkJDSUszUWNacWtjNDRo?=
 =?utf-8?B?T2Y0WUFXQmU1ZU5wWjQ0Q1h0dUt5OXc9PQ==?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZmI4ZThSZkNsRitsODdselFlNXIwK3dTK0xvNEVyU2xqMU12c2J2L2Q3OUl2?=
 =?utf-8?B?dnVxdnZxYjFJZFdvaGY3aFlXbzk1eXl6S05lMHBpaVZYM1YwTDIzQkFwM1Bx?=
 =?utf-8?B?NWUyUTQrK1R3YThrMzdadkZwMmFJT0c1VXRrWUMyQVY2amZ5UzRXUlZ1b3pY?=
 =?utf-8?B?YjlmQjBmY2RuTnBpUGs3R1orYzFYQnNrRkswZVNDSjVaUHVnTytyUk5rU1ph?=
 =?utf-8?B?RWtPVUIxaG1YQ0xmY1BQQjBaRXlzb3JmbzhCd1R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dZajAyOGFVREtLUWF6OU9OeHA1Y0Q3RnVYUFJmYSthS3NvSXVmYjZF?=
 =?utf-8?B?VmNrL0RiY2d4QjdOY0NNTDF5VkJIV1cxanFoNmtpc1JpTFJzaWFOOXFJL012?=
 =?utf-8?B?UVJjT20wRkFKZkdmaUdvbG8vZE5xUzA1aDVZN01vSFRlOHZOSW1wUzA1emZ1?=
 =?utf-8?B?SFE9PQ==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: 74e4629d-8ed7-45a5-bef3-08dc81037056
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 23:51:35.0895
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1SebOemQjMg3VG5XTeI8eLzYJog0Sm+rUgLFY1ON/bfLeNACJoPUhlezwo4hGG6cRWK11N5FlzVjva59EoiFpcY+PdV1zt0yHWp577uYEyA=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8498
X-OriginatorOrg: intel.com

Hi Tony,

On 5/30/24 4:46 PM, Luck, Tony wrote:
>>> When SNC mode is enabled the effective amount of L3 cache available
>>> for allocation is divided by the number of nodes per L3.
>>
>> This was a mistake in original implementation and no longer done.
> 
> My original kernel code adjusted value reported in the "size" file in resctrl.
> That's no longer done because the effective size depends on how applications
> are allocating and using memory. Since the kernel can't know that, it
> seemed best to just report the total size of the cache.
> 
> But I think the resctrl tests still need to take this into account when running
> llc_occupancy tests.
> 
> E.g. on a 2-way SNC system with a 100MB L3 cache a test that allocates
> memory from its local SNC node (default behavior without using libnuma)
> will only see 50 MB llc_occupancy with a fully populated L3 mask in the
> schemata file.

This seems to contradict the "Cache and memory bandwidth allocation features
continue to operate at the scope of the L3 cache." statement from [1]?

Reinette

[1] https://lore.kernel.org/lkml/20240528222006.58283-1-tony.luck@intel.com/

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11])
	(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 C7C4DEAC0;
	Fri, 31 May 2024 00:34:12 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.11
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717115654; cv=fail; b=nO0eO6/HJmpld3gjMc1lVb2kzHUYSYCPqNLcsQDntYbBa60NH8t9lcW7bvEi8HYOfFGbnSDfv7LO9TYjUNsuXVDXO9OlUfBOZ3yET3ZxgBEF+NvvtOQhQBAVVFIopDAu3lB5rTjh/EEqFLxn1z4qCXz3ne6zc1DqE6fYqMVw9rI=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717115654; c=relaxed/simple;
	bh=irrdjYbai8zopap8Q/cs4mpXwBod4evTBHauWmoRMZ4=;
	h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:
	 Content-Type:MIME-Version; b=bJO9+X1hrob/PtuZJhxHmOtsJnHcoHbPsj3ALbICCS/M6hoF7pAplsTIhbtI8/1Zq8gwJqiZ0zbl8dYRpWNr0sJHOxYhm0vAcBhpbB6upRGhrsMl5sTNhiLmkthZAia7QZtygIIu1YwT7L7rFhmY6QaxyaSLlMeEmE9CtH/SZIw=
ARC-Authentication-Results:i=2; 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=R+XPWx+s; arc=fail smtp.client-ip=192.198.163.11
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R+XPWx+s"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717115653; x=1748651653;
  h=from:to:cc:subject:date:message-id:references:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=irrdjYbai8zopap8Q/cs4mpXwBod4evTBHauWmoRMZ4=;
  b=R+XPWx+sAdU3tooj84MJsvxdvNDZ1tZx8b0p6jhIrdNNftaxkgZpMxeh
   JtVXHBBMFRpRyJiLEpPz+xOTDxOTCQSpk5GNpseBx7vUGBMOcNk6vHonA
   7SABnFY5thWKmIELTW/J+9ZH96SZltE9VP2dgyKyYLF+HYWsdd6AkHJw8
   ldhMB6fhBmp039WhMTkKHWZ6NUwZDhZVpmIs6Wlm9bSEk45qjUII5mLd0
   6WQcNogCnwdLuXwG0ND9RwB8dyFyMolOsYhkFi8qTIMFaU/98dZ/gm/jb
   KuxMs4FXjbPby2W+S67BMWatzv3q2nldHHyF+im+xRJzCQVFoFIpjF3J2
   A==;
X-CSE-ConnectionGUID: OTaRzyZsRsW+p3tXKeIEIw==
X-CSE-MsgGUID: 9Rcvp2JLTYiiQmzkkJOwDQ==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="24277571"
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="24277571"
Received: from fmviesa008.fm.intel.com ([10.60.135.148])
  by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 17:34:12 -0700
X-CSE-ConnectionGUID: tMJC5Fy4QPS0+44BNg9o4A==
X-CSE-MsgGUID: PqdUe9dEQKGipo+N5Z8I1g==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,202,1712646000"; 
   d="scan'208";a="35992556"
Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14])
  by fmviesa008.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 17:34:12 -0700
Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by
 ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 17:34:11 -0700
Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by
 orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 17:34:11 -0700
Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168)
 by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 17:34:11 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=hKk5lOoI0piFsjr28i04z67kYSFGHtkviyCaKOLNtMJCgvlqkeWMc2IbQSYYTZcsOHx0nUbrDMfJktrwHZ4lS+boa0ruTMA4yVaRdP0cIYYR/fuRJVei84N51ooeXq3drx1YGB149dDOxly+JoYO1W/aNEOCbIwQqiN+g+5e9rKnESkKvBTxHbWfRzW8UZRDAG62YlU3jkYc+oZ9wOrpRjo7MR1JrAdW322G960dgDCmMCQYZ03xWFD3GEFKNp4RvrG+yFvJjfCvCy8QpHdFDKHR+4akWWjx3tBVLb7bGtUquQCpO5RYacig8UAZnj2BASBWYCBWXZWfb1OmZ5KlBw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=irrdjYbai8zopap8Q/cs4mpXwBod4evTBHauWmoRMZ4=;
 b=OhSDT5VkTq1tNfn9FICsKciOd0t+9OXueyTm+u4kW5VjCy2ItetiwOtouJnu7Gb8MC0dFHYwY/aw8JYKHvuSkecl4aR0+mA0FzAVipOjcqsRPR7JuDOiawCJYHqQWB3IShK6KWOyGHlIPZKyVHEZKjFrCGRln8FalDEo9Jkn3fBVoUZSG5KcrtVtxbKRtP49pQxFknkERqy7skf7oEhm9rPL7nfS9yJmoS3+EW7F8MFtoekOMdqOarS3yPgp27lbW6AEFMkNYor+kFGCOA2h5y0j8st/g0pNkZ9sSU87tvZWYO3HsGrMhGgiS07tAZJr0y2Wa2pG4wFMEtEqhvzxtw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com (2603:10b6:a03:48a::9)
 by PH0PR11MB4838.namprd11.prod.outlook.com (2603:10b6:510:40::24) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Fri, 31 May
 2024 00:34:03 +0000
Received: from SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361]) by SJ1PR11MB6083.namprd11.prod.outlook.com
 ([fe80::acfd:b7e:b73b:9361%5]) with mapi id 15.20.7633.018; Fri, 31 May 2024
 00:34:03 +0000
From: "Luck, Tony" <tony.luck@intel.com>
To: "Chatre, Reinette" <reinette.chatre@intel.com>, "Wieczor-Retman, Maciej"
	<maciej.wieczor-retman@intel.com>, "Yu, Fenghua" <fenghua.yu@intel.com>,
	"shuah@kernel.org" <shuah@kernel.org>
CC: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
Subject: RE: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Topic: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Thread-Index: AQHaprmme8fjFWvJ30CJk2uljzCiTbGwftaAgAAI17CAAAN5gIAACvBg
Date: Fri, 31 May 2024 00:34:03 +0000
Message-ID: <SJ1PR11MB60835941880FC77E1B1E9FEFFCFC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <SJ1PR11MB60833CF8BD209555A5370299FCF32@SJ1PR11MB6083.namprd11.prod.outlook.com>
 <992cd5db-1cc8-4238-879b-8ef0406edc33@intel.com>
In-Reply-To: <992cd5db-1cc8-4238-879b-8ef0406edc33@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ1PR11MB6083:EE_|PH0PR11MB4838:EE_
x-ms-office365-filtering-correlation-id: 7b095f80-2343-4c55-3f55-08dc81095f8c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230031|366007|376005|1800799015|38070700009;
x-microsoft-antispam-message-info: =?utf-8?B?Mm1rc0gwMmVoYytkMTVvRUpSdk1RalRZUHZ3SGI1OXNIcU13OGJaZjVwdWZ3?=
 =?utf-8?B?R0pxZGFETzZu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;SFV:NSPM;H:SJ1PR11MB6083.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?aDlsQ3NUQ01OUjBNRnNTTnN3alJrcHh5YUNuMHJpb0wwRHhzdERDYTQ3NjVM?=
 =?utf-8?B?eW52S1M4TlJMenNBWDdTTTlVNXl2OHlpbUdMTHcvYmJFL2RaSDlhOGZnODZN?=
 =?utf-8?B?VlRUWlUwODYraTdCUDR5ZldtZjVLYklPVDFaa2tFNS9TZGV2VmRTbklLMkQ3?=
 =?utf-8?B?bUdDdGxVQWd5azRtbmNxOWdvalgrL2tOTU5jeVJjR1VndDBuUEtTRklvcVVY?=
 =?utf-8?B?cnZrdkdJZk1JU2ZqQ3lqVHZOcFVROFpBUVE1cEtZQUxsQ3Fmd0pLR2lSQmNi?=
 =?utf-8?B?T2NTalhoR1VsTjdMWWV6WXRCMmEvVVU0UGVrZXcwRHNENFhRR2RCd3pTdUFs?=
 =?utf-8?B?QTlMb1JoUEljc1NWZ1N2MlVBbDlxUEVpQVdzQzVPSzFmS2RLSmJhSkdUTHVM?=
 =?utf-8?B?MDFObXhoU3luY0tBZmRFUUFPUEtnTlpLYWpZdkp2V3BDM3REL3hFbGROa2RJ?=
 =?utf-8?B?MzhMUVArcE5MRGM2TmpNUmF5NVlDRXkyd1pWaFBoeXNmSU9kQkt0ekdjdkVs?=
 =?utf-8?B?c09rK080RTRsNTBWNWgrbG1uOHZFcTI2a0VOQ3JJY1FjWnZQYTNhSmZiNmJl?=
 =?utf-8?B?ZWQrS2JYTnB4Q1JjNHRKV0MrMnBQVDlqa2wzVmZTVndTRW9wMWpVV21IemlP?=
 =?utf-8?B?UXpCVXpDbXJWMkQyMnNxdkdCUFJuOFkxeFI5M0RZOG14T3Nyb25UWGUwM1lR?=
 =?utf-8?B?ekhZVEJxRlN3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UFmYTRZZ0JtSDIzbEZqTWVaSXMyNHFo?=
 =?utf-8?B?QlJpTi9GSzE5UGRPajNFekQ2NFBpbC8rbkRjdStVRmhmZ2RmNnI0cVNMVy94?=
 =?utf-8?B?aUc5MzJNWG9tdk5Vak1ZT000TDJIRVJFTjArZG1BRTFuSUZmS0lTWWRTK3Fq?=
 =?utf-8?B?eEhSa3dpMEhUNXkxaXcwQTdhWU1VekFlOU4yL0lIbzkyL1EyRk9hcXE3bmEy?=
 =?utf-8?B?eWRrYWR2Mzg1V2dSSXZoNkx3SEsyZWVIRTRBajR6VjZUTEcwK3FCVzlqVlF0?=
 =?utf-8?B?aU81dlBTVE52V05sQ2ZQemNjVFFjUGVwRWtFYUtuWi9JRWgxYjZvbWhBYjZD?=
 =?utf-8?B?RzkxWE92aTAxcFJjZkIzd2E2L25tc3R5Q1JCc1lWL1o5d0hIL0UrY1VmcGpj?=
 =?utf-8?B?cHhKOVFCZDhOSkRHVndzU1dOTVkwVFg3NlFUS250eVNsanBYY3EwSTVyN3p3?=
 =?utf-8?B?Nk9GNzQwTGJJeG9xVmVKWEFkbmpDck5YWjRPRG1udDRxa2w3ZFBWYmt3TnVz?=
 =?utf-8?Q?hzlHBxwevdEXhzKFWBYi9N+ZE?=
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ1PR11MB6083.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b095f80-2343-4c55-3f55-08dc81095f8c
X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2024 00:34:03.7378
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: RZcNH1lYnadvUylIeK97HDDfiEMlG/PnoCuTQjUHC+1e9uFJZmg3HWB89Po9orGm0msiMtBlShQ7HzPEjaswlA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4838
X-OriginatorOrg: intel.com

PiA+Pj4gV2hlbiBTTkMgbW9kZSBpcyBlbmFibGVkIHRoZSBlZmZlY3RpdmUgYW1vdW50IG9mIEwz
IGNhY2hlIGF2YWlsYWJsZQ0KPiA+Pj4gZm9yIGFsbG9jYXRpb24gaXMgZGl2aWRlZCBieSB0aGUg
bnVtYmVyIG9mIG5vZGVzIHBlciBMMy4NCj4gPj4NCj4gPj4gVGhpcyB3YXMgYSBtaXN0YWtlIGlu
IG9yaWdpbmFsIGltcGxlbWVudGF0aW9uIGFuZCBubyBsb25nZXIgZG9uZS4NCj4gPg0KPiA+IE15
IG9yaWdpbmFsIGtlcm5lbCBjb2RlIGFkanVzdGVkIHZhbHVlIHJlcG9ydGVkIGluIHRoZSAic2l6
ZSIgZmlsZSBpbiByZXNjdHJsLg0KPiA+IFRoYXQncyBubyBsb25nZXIgZG9uZSBiZWNhdXNlIHRo
ZSBlZmZlY3RpdmUgc2l6ZSBkZXBlbmRzIG9uIGhvdyBhcHBsaWNhdGlvbnMNCj4gPiBhcmUgYWxs
b2NhdGluZyBhbmQgdXNpbmcgbWVtb3J5LiBTaW5jZSB0aGUga2VybmVsIGNhbid0IGtub3cgdGhh
dCwgaXQNCj4gPiBzZWVtZWQgYmVzdCB0byBqdXN0IHJlcG9ydCB0aGUgdG90YWwgc2l6ZSBvZiB0
aGUgY2FjaGUuDQo+ID4NCj4gPiBCdXQgSSB0aGluayB0aGUgcmVzY3RybCB0ZXN0cyBzdGlsbCBu
ZWVkIHRvIHRha2UgdGhpcyBpbnR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p
bnRlbC5jb20vDQo=

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12])
	(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 CB18A249F5;
	Fri, 31 May 2024 06:40:07 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.12
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717137609; cv=fail; b=Aqjrrwo4QlziTSYyua917AVZUIozeaPcOpbT0D75+5BatkvyBeH4pl92pE1t1u/qk8rZubXJxjI5W/2lYa0n/a+6CQdkesnb/WqQiRy2FKxFdNmgfpdKtiGAFJCdI9xOGaoLIGR0cX31Ug3wcQbpSmw11dJbC3UTloWQCG6JouM=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717137609; c=relaxed/simple;
	bh=n64AvCPT4IsniUq93Yy2PDLJCicwa0+zNyrSBluq3DA=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=jb5mJpTdtcmg6/v+8ANnCsZNGMieVdNkTxRX24NqqAa/2qMctagCFbHPevsGX5PQXhY5CeRItJYEhozOmy09Ksb7m01jSzwdZP0o0YQIFN75vEIdX/75PJzdrcJfIqmNWSUPoJ1kneIw1Vpm+AqaDYFhFUlSBUD4sOCdXxJmEQU=
ARC-Authentication-Results:i=2; 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=Zav4Y0JQ; arc=fail smtp.client-ip=198.175.65.12
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zav4Y0JQ"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717137607; x=1748673607;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=n64AvCPT4IsniUq93Yy2PDLJCicwa0+zNyrSBluq3DA=;
  b=Zav4Y0JQo3Xu9PYQNYuh6wBPtUdCO/O+a3C51qG37HqDRM6S2pJUoiul
   ZqvaluRKX2LsEkVAsndkhzC2K53yeTwwLkFvPc4drnrfOr6mjvfnokcMB
   oxnLSYksLB4sYBvFNO859I2+sUGMYE4j9Gn+bNHWFnJzzq5GMyj9K/ArJ
   pp5QDCy/zYsWzur00qnNFZ0Q+ViqhQkXP+rumCA+3Tpke8uRp1DyilvR6
   gyzKqhfidNoa3QrqNm/1mL7S2EMenCaZHuFiwh9W9/+/F2DJ3JYtixcXL
   rYHY6F5sK64qi3X/jQlT7tmnIU0k5ot7ZG00JUWk1A7MyB+6VgpodtXys
   w==;
X-CSE-ConnectionGUID: XmoZr4HmRjuNUvR2xKVLUw==
X-CSE-MsgGUID: crThXCp9QlWssvIb0e2sFg==
X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="25067983"
X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; 
   d="scan'208";a="25067983"
Received: from orviesa003.jf.intel.com ([10.64.159.143])
  by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 23:40:07 -0700
X-CSE-ConnectionGUID: i919I+baRBe9Vi2x6vT7jw==
X-CSE-MsgGUID: Dd9g4cmBSnGuXdut8oQmsg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; 
   d="scan'208";a="40990534"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
  by orviesa003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 30 May 2024 23:40:07 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 23:40:06 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 30 May 2024 23:40:06 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 30 May 2024 23:40:06 -0700
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.40) by
 edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 30 May 2024 23:40:06 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NsnkYUcD6aLua2vZquuuj8Q0J3MBn2FSLdOFhrV5LnZ9CdkKs5aRFLtd6pVw7IEMEhbwL9e26sH0mg6GPPdU7OFMWMcNHE4KYPa6hmLp0aAbMdcSOHHl8YuI44FTne3GyH1UWEUJuBl8ZMy+FSnaeqLgTyp150AoM5x/GZYKb65nqKiTtREMXg32VWUn1m3jzfNESkYiA8azalcnDHaGUTXtq3ZJrsAYSqso7oPcfe4Gl1TXb7tn3qzTlIPLj8tvBfjfdXMCnFeD5WESV6OduVext4OOCJbCjL3RuLpNfQ5mPzSiMnzHIBkaVAKooJgentiTt0YdLyq7ILE0HDMcvg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=g5fi05VHHzigryPOPysmCCW1Si2Iemx+6r0k4tJ70r8=;
 b=nulQBt+DqJ7ZC4Q/lp86C1E+EJ0gRLWENKNFnTi7vAFY3JgRkMJZ2KP5GsRFOBn8WMvnT40gpgcKdqKzgmQJa/5nIu1/Of4f6oJ2f7ZmlSG1vjO6B+8cxxD7Zn10L5JGUrkfeLsb2/ryHLtAfFalOg64YiKQo4H62yVNcSFBP+xvKljylzPVD0t13MhHit6L7Nkby1SVsj7mRNvPUwOK8+yaAIZ0oQbWMVK9SbQBlZQBI1VyvT0HYjvzFZ6fkf6yRT00RditPyOZFCQvDugUg9FxatPV7p+u/0h7LwWzPf/7gk9We379UlpUGJ7x2PLwoNK1A1/wb6qOXQIt61wz5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by MN0PR11MB6254.namprd11.prod.outlook.com (2603:10b6:208:3c5::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.24; Fri, 31 May
 2024 06:40:03 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7633.018; Fri, 31 May 2024
 06:40:03 +0000
Date: Fri, 31 May 2024 08:39:47 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
Subject: Re: [PATCH v2 2/2] selftests/resctrl: Adjust SNC support messages
Message-ID: <foz3qzdremrnxzfwltucbyugkiieyoxg4vhml3csu2yodnfld4@bxvyu44msaxc>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <16764746e8f9f42cbd45d61210764a9b67085cbf.1715769576.git.maciej.wieczor-retman@intel.com>
 <d8396d97-5000-4ffb-aaba-e71de5d6d909@intel.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d8396d97-5000-4ffb-aaba-e71de5d6d909@intel.com>
X-ClientProxiedBy: BY3PR04CA0025.namprd04.prod.outlook.com
 (2603:10b6:a03:217::30) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|MN0PR11MB6254:EE_
X-MS-Office365-Filtering-Correlation-Id: f9b83dbe-5581-4990-e37c-08dc813c80a3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?OFsVFHHHxItMm9JYJXTwP0xEhpnc3W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QOiYBuaviy?=
 =?iso-8859-1?Q?xZoVl2tNNNdi2VDcCPEq7sdsUK1Zfghb8XrK4Cj+zdSijGt7hp2BatnJW6?=
 =?iso-8859-1?Q?pBp3aQbOWC4Q4rsHV2dZqWLYuo1mkGL2iM6rcx27Dt7qEAQeEX6Cdte43C?=
 =?iso-8859-1?Q?0UQj4cizguQRcUdRU/eZqP4Cm8RKEhy247px2WrF4Q9qABL6huIIfRde2S?=
 =?iso-8859-1?Q?MgimyC7WwNADRGWm5JwDKPMYSryfmneW9jDXBghTD6ZJQcqVdQNNqnwdQ7?=
 =?iso-8859-1?Q?U44fvQvOh2A/EoFg6SkRyf1CnobIN7vs2k8Nxu3cvqDz9ncnYYEr7FM/sS?=
 =?iso-8859-1?Q?E8a3RYYC7zyAgdZm2ee2LfUb4Xp9IuhP7Us95NqKy0A+VXfj86t9J+4bYK?=
 =?iso-8859-1?Q?CSdwPdEWG5FB+uGUJZA11TcfQKPDrsRdBkLvfDdOA=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?Q0a4WsRMiwqB3PVAbglWoRaa7fOTgBhbYYHMcRixocV9l/qYrUV8EX6TzL?=
 =?iso-8859-1?Q?MVbq8JpKox593VkWA/oysV+AaE2VbD7tWow7taejHPuOF6uhiI1XctkNHE?=
 =?iso-8859-1?Q?JNLeLIezi5TJ9QV452mI4C1VPHurT1desmWexQKsXK5wMHjw5z2sbBy64/?=
 =?iso-8859-1?Q?F4ug2gAoMc9SduXtica8s/Cm32Ho0EkBWy3U1x2mTalTzuLkHhDtLfBorS?=
 =?iso-8859-1?Q?9g/Hzw3Nw9x+9t4OaK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Ue61AzaeUlZWFVOfxr6PiILzXqBGnhXb?=
 =?iso-8859-1?Q?MSwZsZyh37yhDXMSI44SwQKoHHDkeJvJEZBHb8XQ46NGzeA3qcQDBeRB64?=
 =?iso-8859-1?Q?bUuHYw4x5VVU09+fARpQmolDxy1e8oMzDtfp4tzhOI2jQUbpk6ZBceQQ6V?=
 =?iso-8859-1?Q?KVEFnbUpSgZALZgN+CDx/2FdUhKedIZy4p7KL/d5Yx4CyR8sWnda2EWgp+?=
 =?iso-8859-1?Q?QGLYPb82KrXWEmrJXixqvFb65bSHFYGJwLLhgz8LXVSkvvXnJJYlwVCaLP?=
 =?iso-8859-1?Q?2hvJHdt/2+wT+PpWqjORjkvF9rnuZoJvV2ODu4Hvy2qOCOIoV5G9wcia3A?=
 =?iso-8859-1?Q?T+LhsNY7CNoHiqNljdGRRS90Gc8/6nCeHJzx3EIp7fJKX9swXsyO1n6Bk1?=
 =?iso-8859-1?Q?AcWTSvvgW7+t4bgYljG8sOmvP0bGLLRFSk4HJ9O4AvIqPJYgns9CJYlBnq?=
 =?iso-8859-1?Q?l9i5V4oiLepCeLTAATGhr71d8HD4mpnNoq5Al9ZKfXbMVoYQTlfbLET/5h?=
 =?iso-8859-1?Q?qpwXK38xx43uwK8xH7IUx97kLcGramTn2MLBQIVPrmyLw1X10YW9xGr8J9?=
 =?iso-8859-1?Q?7zE5SnNr4Qlv4RlXND0=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: f9b83dbe-5581-4990-e37c-08dc813c80a3
X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 06:40:03.7165
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1XqMerG50Kl04PoCFwQOrpxOJFU7L0gaCDsnGSWj+KNHb3akafZxZe+ig22XZJMznOkpb7HGFJqIGoNHTbrC4frAwI0PP64GfqK+g2IZhPY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6254
X-OriginatorOrg: intel.com

Hello!

On 2024-05-30 at 16:07:34 -0700, Reinette Chatre wrote:
>Hi Maciej,
>
>On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>> Resctrl selftest prints a message on test failure that Sub-Numa
>> Clustering (SNC) could be enabled and points the user to check theirs BIOS
>> settings. No actual check is performed before printing that message so
>> it is not very accurate in pinpointing a problem.
>> 
>> Figuring out if SNC is enabled is only one part of the problem, the
>> other being whether the kernel supports it. As there is no easy
>> interface that simply states SNC support in the kernel one can find that
>> information by comparing L3 cache sizes from different sources. Cache
>> size reported by /sys/devices/system/node/node0/cpu0/cache/index3/size
>> will always show the full cache size even if it's split by enabled SNC.
>> On the other hand /sys/fs/resctrl/size has information about L3 size,
>> that with kernel support is adjusted for enabled SNC.
>> 
>> Add a function to find a cache size from /sys/fs/resctrl/size since
>> finding that information from the other source is already implemented.
>> 
>> Add a function that compares the two cache sizes and use it to make the
>> SNC support message more meaningful.
>
>Please note that the new version of SNC kernel support ([1]) that this
>series is based on no longer adjusts the cache size. Detecting kernel support
>for SNC (if the new solution is accepted) can be done with the test for the
>existence of the files Tony mentioned in [2].

Thank you for your comments on both patches, I don't know how I missed this
fact. I'll revise my patches accordingly.

>
>> 
>> Add the SNC support message just after MBA's check_results() since MBA
>> shares code with MBM and also can suffer from enabled SNC if there is no
>> support in the kernel.
>> 
>> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
>> ---
>
>Reinette
>
>[1] https://lore.kernel.org/all/20240503203325.21512-1-tony.luck@intel.com/
>[2] https://lore.kernel.org/lkml/SJ1PR11MB6083320F30DBCBB59574F0BDFCEC2@SJ1PR11MB6083.namprd11.prod.outlook.com/
>

-- 
Kind regards
Maciej Wieczór-Retman

From mboxrd@z Thu Jan  1 00:00:00 1970
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 ED84C15B128;
	Fri, 31 May 2024 16:17:54 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.21
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1717172276; cv=fail; b=C24opIwRYqDIgjoHdhDPl9x4s5beXnvDbWrkxbLPc+CW/wdWsgJN1lUJGYR+/rGDpekdgJbKc4Anf8ZCtgitR7X7wjVyE38BVPq3euEPmN8df5+F2XLme9D+3XC10FE8UNjWQxRauMGbIptrsC7WFmd61tY4mdJC5IpRQwZZGbQ=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1717172276; c=relaxed/simple;
	bh=o4VMpdWdINEY0cCSjoyLAxvvw6IQbiRZJy9s7UGvE/o=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=an+5deVtMU8xp8WokCGtP3LcEUIILFyXfreI5U6D7pmMGJIkCIo3oLUEH+YJ6vwezZFzPTFa9H76+x1Q9FSY01uP1/HVHtnAXC4LIesJANhsYKphjHWrmoUN3XanAsu0v6CIncOle1E2tJWjlxXYx4tzYWwVH6ozJ0y+sjfHmgg=
ARC-Authentication-Results:i=2; 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=JSJEhiH5; arc=fail 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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="JSJEhiH5"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1717172275; x=1748708275;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=o4VMpdWdINEY0cCSjoyLAxvvw6IQbiRZJy9s7UGvE/o=;
  b=JSJEhiH5gu1issgPDXbmJVwbv8gkKhKBtfaZhlLIjruLShFOPscAdRIv
   3Wmpphs4L21ktkG9ypxIUWx1xTWT6IjiaSq+GWOgiIcteuRV9VQFWaroL
   C5hDezh0tbHMKq/NmA22OqctcA6HaakEMMyKHSka7vzLse7C/ZoVvG/QO
   X1k6ROMVTXgvp8CSn6o3yVGlo1FmPAU24rucZhU4EV+UY0h55TuHvmQFo
   9B/rZ817WNi1/yECdyh7QWsjICLUyeg0L3yGYDw9pC7+2cttL5BHIHukV
   eqJTs20r+NtpaSMR4pUqMvsOJC8Rz3KFA9jrzrwT2ma+m66ua9PjTD3Ys
   g==;
X-CSE-ConnectionGUID: VS5OSXGLRNeCbQD60bLK3g==
X-CSE-MsgGUID: ch1CnxW0TA613joGKyjMlQ==
X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="13672952"
X-IronPort-AV: E=Sophos;i="6.08,204,1712646000"; 
   d="scan'208";a="13672952"
Received: from fmviesa005.fm.intel.com ([10.60.135.145])
  by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 09:17:55 -0700
X-CSE-ConnectionGUID: eIIVRU+oRXeV4nUebXiZfg==
X-CSE-MsgGUID: bJ7mNmMASWyPKGgEVp5PyQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,204,1712646000"; 
   d="scan'208";a="40654455"
Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14])
  by fmviesa005.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 31 May 2024 09:17:55 -0700
Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by
 ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Fri, 31 May 2024 09:17:53 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by
 ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Fri, 31 May 2024 09:17:53 -0700
Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by
 orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Fri, 31 May 2024 09:17:53 -0700
Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.40) by
 edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Fri, 31 May 2024 09:17:52 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=JyHWguQmk5VA3T9dqfBCbACD3zhdfdjHsqILFeSHr5tqGKwjHpTcrg9lnwQe1ZJXjpnIL8bR+j7i3qQJZwcnSPxAYF1csOe0mbgfk2cEjEP1BgxosmrjW19Csq+PR9vPeknYxOzufJqfsJPI6P1R6VAQ9WlX8BGsBJaIvFP87jtdlcznCS9eb8kXSxZHrQgpNe6PnAfN62jOVOG5oUHaW2t7QlqL6ydavMD3Dd1WTjqKFtRIGdagr0NR6EPy//3DzrxOPZNNcDx4R59c53P78G7zhtyzsHWaR8uEdRSHfoCOtlqnPishlYUYC1w8USk0ZkaoCUGGHhb27wjNo75m3w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1sxFtcpEpwK6aJsRlY/eKfUVO+rcwC10z+TRd0FeimE=;
 b=aZO9ORBsEUayFd6u1J3rUOdwdnkZSz1q8+Ad+hHicBN9Z8fpBf8r18AQg6Vb8b1gGPkgRBDqwCuWPmkpe2XffLdJDGd5EH2FRfZ/4X/uTEpSbSo6ZLcesn3W+Ily7cWUVVoIN8yR5DjJlFPPmMwId3s4DYVwcOsvBj9lLj480TR8OVgOEAsXRMuUuIgqNFkxMiCEjknrYBqziU/SBYf0M8UZXRSRmwMbdgj/3SNY+njTSjhFgmhCe5W0X8YBtgUdXDmC42qXVTQljgPr7+akWAtwNX17UUAR07BOwDGjfKmw+OJCxYwA7lGFgRl1eSaO6FxmdPZac36u4WKDVEXGQA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by SA1PR11MB6845.namprd11.prod.outlook.com (2603:10b6:806:29f::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22; Fri, 31 May
 2024 16:17:48 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7633.017; Fri, 31 May 2024
 16:17:48 +0000
Message-ID: <07325558-c816-42ec-9f74-464df2f98e9f@intel.com>
Date: Fri, 31 May 2024 09:17:46 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: "Luck, Tony" <tony.luck@intel.com>, "Wieczor-Retman, Maciej"
	<maciej.wieczor-retman@intel.com>, "Yu, Fenghua" <fenghua.yu@intel.com>,
	"shuah@kernel.org" <shuah@kernel.org>
CC: "linux-kselftest@vger.kernel.org" <linux-kselftest@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <SJ1PR11MB60833CF8BD209555A5370299FCF32@SJ1PR11MB6083.namprd11.prod.outlook.com>
 <992cd5db-1cc8-4238-879b-8ef0406edc33@intel.com>
 <SJ1PR11MB60835941880FC77E1B1E9FEFFCFC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
Content-Language: en-US
From: Reinette Chatre <reinette.chatre@intel.com>
In-Reply-To: <SJ1PR11MB60835941880FC77E1B1E9FEFFCFC2@SJ1PR11MB6083.namprd11.prod.outlook.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR03CA0157.namprd03.prod.outlook.com
 (2603:10b6:303:8d::12) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|SA1PR11MB6845:EE_
X-MS-Office365-Filtering-Correlation-Id: efb21aef-c31d-469a-1e08-08dc818d368e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007;
X-Microsoft-Antispam-Message-Info: =?utf-8?B?NURJT1VOZzFsL0NpVENRSC9iWkJXL0x2YkRnZTZ4cS9Gb1RkMlN1VFF1V1dk?=
 =?utf-8?B?djE5WEhHRlYwSnMwNTRXaHpDbVRiOEltNWFnQzIwYUVjcTlyV1VGTFh6OHU0?=
 =?utf-8?B?WGxMSmtTbjg5V0xFa2pTdGlwQUNXcDNvMkNYblI2YUlnUWFpLzZPQmh5cm1z?=
 =?utf-8?B?YlNFOTFya2dDM0JmRHBOSnVkMldUblFiTnlLVzRuZzVaZHZUNEMyVzJKSlpR?=
 =?utf-8?B?ZWVySEFFN3dTR25tU2ZsZnVuS2lmQ0cxRFFmVGJneisrd2ZCK0lNRVI0cERY?=
 =?utf-8?B?SmtXZWtCUG8vY0VUZGNGc0VYU1ZqaWJwU0RpdDFkVjV6R2ZLSnRZMjFzNVpI?=
 =?utf-8?B?bDNnNEtRKzdNWkR3enZ4SXI0cEpFNUh4aFJGZXRPOVNTcVNZUGEzTHNWN0Mw?=
 =?utf-8?B?MXhlZ2ZaZTh4Z2NhVUtQeEhRSkJMbTZKb3ZHMWswODVTRDU0amYvL2VMNjIy?=
 =?utf-8?B?cWRYNklMYTBnRVdTcFhGcDJhTFNoOXk0Tm0zMno1WVpmMy9CdXBoRXRCcDhE?=
 =?utf-8?B?Z1M4ZEcxWnoyN29mdFVDWDhYN0xvbFFiNDByNXNLY2l4d3lTVGV2WGRUSldz?=
 =?utf-8?B?bjZWVit6MzNnMjJFNU90bElYYzVEZVRNZHYwMmsvalJtYnRkT2hDckJsUnRh?=
 =?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UJQeUJKa0FHWHhjeDNQa282aitzNFlua3R4WFZyZHBZ?=
 =?utf-8?B?dW9LNm02WXd5SDlPWXJpRXFHdTRUWTBESVh4VmN5bnNhMHhjL296L1l3Y1NU?=
 =?utf-8?B?TDFsNVpZYXJSV1lSSWdicHZ4dG1LUEFuY1ZVeERCbTdWd1pHYnBqUm51cEFP?=
 =?utf-8?B?YTIxUG5qWlN0M2NUSjA2ZHh4NlgyTHVFUXNqZ3B0M3Vld2dQd2dVQWdRPT0=?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QmJVOWhMNy9NS1E0Tm5RdDhvRk1oRlF0dUNxNUt4MHpIQ1R6KzE1Nm5RRmZK?=
 =?utf-8?B?R0lXVjFjRGRFSFdXZzIxblZ5cHlYd3FUL2Vnb2pUcm9FYnhoV3VrZm5BeHpt?=
 =?utf-8?B?aHpSSHUwc25tbW51MThZWnhGQ3F2VHFlbUV5Ukx2M0tIWDVvT1Y4VnBoTzho?=
 =?utf-8?B?ODhuRXB3UlF1MWRjRzlvam56SzZRVG14OVFzR3FhMzlJSUJmcVpnNnJOZ3Na?=
 =?utf-8?B?QnBvd01KcDFpWk84ZDdKcW91NnNNazMxYXBsbFM3VGc5Y3FqUzI1S0xJR1pv?=
 =?utf-8?B?T1JLcTcrMzBmaHZMTXZJVkdGMG40WnMyZEU4WGxYZThTZDFLeVlpUTFtVnNr?=
 =?utf-8?B?SE1CYkoyTVVWUkVSZkxjc1hmb0tnZmd3V2JtNDdkbmh0YUcrTllVUmtPSVk5?=
 =?utf-8?B?NU1rVVdKdDlFN3lXNCtQZEUyMUg2U2ZtRmRPbDZhQkd2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==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: efb21aef-c31d-469a-1e08-08dc818d368e
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 16:17:48.6491
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: /86e0fJobXSa5E4cnQbBd4B52a21EdKwO3hWhAVeE5RJCQUCYbilOopLMS9Ob3HsvBFVaNuKrqwlxt2luwTYPFvxJ3+qVThmQxaS7A/fhWg=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6845
X-OriginatorOrg: intel.com


Hi Tony and Maciej,

On 5/30/24 5:34 PM, Luck, Tony wrote:
>>>>> When SNC mode is enabled the effective amount of L3 cache available
>>>>> for allocation is divided by the number of nodes per L3.
>>>>
>>>> This was a mistake in original implementation and no longer done.
>>>
>>> My original kernel code adjusted value reported in the "size" file in resctrl.
>>> That's no longer done because the effective size depends on how applications
>>> are allocating and using memory. Since the kernel can't know that, it
>>> seemed best to just report the total size of the cache.
>>>
>>> But I think the resctrl tests still need to take this into account when running
>>> llc_occupancy tests.
>>>
>>> E.g. on a 2-way SNC system with a 100MB L3 cache a test that allocates
>>> memory from its local SNC node (default behavior without using libnuma)
>>> will only see 50 MB llc_occupancy with a fully populated L3 mask in the
>>> schemata file.
>>
>> This seems to contradict the "Cache and memory bandwidth allocation features
>> continue to operate at the scope of the L3 cache." statement from [1]?
> 
> I'll clean that up. MBA isn't affected. But cache allocation is affected in that
> the amount of cache represented by each bit in the masks in the schemata
> file is reduced by a factor equal to SNC nodes per L3 cache.

Thanks Tony. I trust that this is what Maciej intended since the change
is specifically named "Adjuct _effective_ L3 cache size". I'd like to
recommend that your comments be added before the change to
get_cache_size() ...

	/*
	 * The amount of cache represented by each bit in the masks
	 * in the schemata file is reduced by a factor equal to SNC
	 * nodes per L3 cache.
	 * E.g. on a SNC-2 system with a 100MB L3 cache a test that
	 * allocates memory from its local SNC node (default behavior
	 * without using libnuma) will only see 50 MB llc_occupancy
	 * with a fully populated L3 mask in the schemata file.
	 */

Reinette

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16])
	(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 C237F1095B;
	Tue, 25 Jun 2024 11:05:01 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.16
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719313503; cv=fail; b=rpIXnkvqIOr0cXdzhF6U7/y4dZ5iOnd/wPcyUbDHVAvxyhLIpR5wmEZ1kod5UYu6Jp3xAayrIl9C8G+us6XHsDIP6ogKuR29hzvhZ/I5qKUGa1oD6MS0V7i95WCesKMMZVS+44a1kyzoBLmHn0jHCfl2qPQ7x/Ju6DxIN6Ld2s8=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719313503; c=relaxed/simple;
	bh=55EZyhJojugOUSd5rophhaTExUHMS1HND0J9hF3Y2LM=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=NYHv4OAj34skpWU/yXav7AM+S/xS1aUKcioIwDhFmQFk1+GcS1lY2wB070Qb/ucdsbZ5U+Zk7Z01FT7HpUWGD4/oqwkNavKK37uni34jYlNQ99mKTeMBbd2Sk9bQ5LPtNTO/Dr6fZFvG+0lNixHG/wr/D1KulZueKjnbFlXiJjc=
ARC-Authentication-Results:i=2; 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=Zq7e4D0Q; arc=fail smtp.client-ip=192.198.163.16
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Zq7e4D0Q"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719313502; x=1750849502;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=55EZyhJojugOUSd5rophhaTExUHMS1HND0J9hF3Y2LM=;
  b=Zq7e4D0Qq/QOUd3kki8PFgRQqjxtL2DRCPaCCzbv9YXUsfdhGcFbfNjr
   ovkpW/HSRl0upqNn5Oaa9Jo+5SHGat4Z1O+cf4eVFAMJ1Acprs/+O2TaQ
   KkM2ifwEkehHtaaXYMcgMgxFmFnT3X2y3n4y+G15Ft8CfAQvOhFkaA66+
   gHi7FfiX0bL4LyyuzfD4TMTQykMa4jxVF/8d51dwSiFiVo1k8i8mJDTjB
   RSIIR7Rld9oIspSYZB6e6WOCC8xm4inHXYY4uAonWwbkDcBb0i01WWYyH
   mUM46Sbmt5jkmpcyRFmyVx+G+47+KuR1WCawYxkQc5ewz29o7q1CXwQ+Y
   Q==;
X-CSE-ConnectionGUID: xCU833zUTEuXundGMqQ5Jw==
X-CSE-MsgGUID: DkRj7S3IRUeadQrw//qZUA==
X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="12236171"
X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; 
   d="scan'208";a="12236171"
Received: from fmviesa004.fm.intel.com ([10.60.135.144])
  by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:05:01 -0700
X-CSE-ConnectionGUID: M1fqusF6TJ6gQR0KdX3hmA==
X-CSE-MsgGUID: qsolqGzaSVyrAcpbsimJDg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; 
   d="scan'208";a="48170373"
Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81])
  by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Jun 2024 04:05:01 -0700
Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by
 fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Tue, 25 Jun 2024 04:05:00 -0700
Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by
 fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Tue, 25 Jun 2024 04:05:00 -0700
Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by
 fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Tue, 25 Jun 2024 04:05:00 -0700
Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.172)
 by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Tue, 25 Jun 2024 04:05:00 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NA1jiGukwvRjVSZpyiCoL/ALcLj1/DonYsqZdf4D6F5uuogQRkq8L318ZK7tbLgFxa9mR2CbP6cBnYcyMYkTzPsvDT9hAD7o7+iJHU7+6D8iMspyq0nkanhEI7+4weDGZLkNU9quqg3d6AnMF/SURL1xL7TXJ0c2FAJjTSH8NLbsqiQGhLe9sJJMuhiJdmBEPyyuZOHkCxx01lCn3POPQ00imc8DT67Ub/3VVz6sTl3S/W/opMLSYwM/rh4ML9gV25jPNNXsZRrMYq2PyR0K4ueiBei2uRUA3rpM9CcHEYicp0aw2u8npX43amzfOJ7KtGi6Mnp5hj5oYfMlslWp/Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=S5+UMy1U9vtV0f1g0oqCvXHaQGDkj3yRb/PahpHxqVc=;
 b=NmlGyWiayMAJC7Lb/qJ+/2iWcNUIujgSN6wLmlenImGyyhb6AFkRo0e5jfq6M5n9hz0wlNRQiOFnFPTy3Lqk4pVna3WL2SHas7tmqbknpLt+AR6B/nZ/Xsbzmj312xP6s6oUCRkssT9BUB/gp2ZzBMC48grED8WEwJveZFWraYBV5dlEJT3xUyME7kdX9fAxJnFuz0GTxBCseBYbxD21WYulP13F3yg/OPcqXI5c12SeJg5lbkIz9G63In/Xddz0l2XLb4w+JOSW8Y2Ri2gLLa+nxDbVXNvC8W1hqbG/CbE7DJwtAVH/sViWT98IKIAGCS3qfyEbtGTUgHzWMHjjRQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by CH0PR11MB5236.namprd11.prod.outlook.com (2603:10b6:610:e3::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Tue, 25 Jun
 2024 11:04:58 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7698.025; Tue, 25 Jun 2024
 11:04:58 +0000
Date: Tue, 25 Jun 2024 13:04:42 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Message-ID: <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
X-ClientProxiedBy: DB9PR01CA0013.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:1d8::18) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|CH0PR11MB5236:EE_
X-MS-Office365-Filtering-Correlation-Id: 19a050ca-909c-4e50-e88d-08dc9506a6eb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|1800799021|366013;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?4eMnvhmj0lqkg79uOkVBRKtpXF82D3wuJpy/kfD6zvhZFEo9aoYvKA66ZL?=
 =?iso-8859-1?Q?88ORZ1P1qTr/AkISLorbF2pqhO7VEx5wikHGzD+JwVnyexE7l4Yc7XGcBj?=
 =?iso-8859-1?Q?Kz1+AEnFgI8JrKKX0K28tKeliTaePdFIKZfZssyF9ycHky3BnVw86x1uQ+?=
 =?iso-8859-1?Q?+ZUwQs3FXRToSICehSbhOA5ehcGhzDtY8c1i0x0tjOOlBGNPHgImDEFh9j?=
 =?iso-8859-1?Q?pHcUMUTxE1S2JY5Q1gAIQeZt/f2QL2R+vb+ODoVuWdcHCP4pdEBdX6Mpv0?=
 =?iso-8859-1?Q?cIvcNKMgXCU2xE6OU/Wmhm5nCyQVJ4D/s1s8MxbTaptKPcJokUMpEZn69p?=
 =?iso-8859-1?Q?ribnX6kb2srusvNBDXlDK1H8WYKkT2F6qlJ1Gp1586A82Yurbp04irlmWp?=
 =?iso-8859-1?Q?BzcZerq0f/+oQNL6V5qlbMFDDlWh8juKPLf3vwKcimz+hr6wMHLEaiHyEo?=
 =?iso-8859-1?Q?igAZ9Gbeb1EAbL79V0/GccbCfPaSnyTRYO2UfYAOuoNIVWOjtkgtCbmK8Y?=
 =?iso-8859-1?Q?0dKw7RjAm7rYDMaHdj645v7Kg4WG4khANlWwxoNGthNqX6L5Wc/8yP1j3f?=
 =?iso-8859-1?Q?ooVlIHshAnSnR/dC0SPR2q3Hi0FyYfGRuLpfaRab0sq8LC/9SOzHcNuZon?=
 =?iso-8859-1?Q?tPiexDU9vOyeSwzF5pS01omoLMW+Li0BN+MoZfqLVT67Zic77o3sQklfJd?=
 =?iso-8859-1?Q?2njEmuegFLkMNZUdazU47ObaAAbVKs2pXy9xSM7kmR6hhsta/GVW66QOcs?=
 =?iso-8859-1?Q?noqUAXlTgP5NVgfjMPrpCJKuKLx5rH2n+Q4imd4WcltL6VTB0Eef+R/Qw6?=
 =?iso-8859-1?Q?QWXfv603XeMm8LOo2eQZdgo8OwGUvA5Mmg7shMbHLdEZrlGRCPjMyRxUtC?=
 =?iso-8859-1?Q?H4aJsRDQQnOiDY0qhY6X/v2v/4cVZPJ28tK/z+TkusN6vhiwh1RpLp/acK?=
 =?iso-8859-1?Q?kCLtGWTABaeXJoTZvaB6wpXTnpE+/2ozHHBoTtfi7jUDQGsJxFRVmIaG9p?=
 =?iso-8859-1?Q?4E6FlsYgm4S0dLKV/cWG0Bs+fG3g7MutmaWCL4o2Yo5JSFYgdf2MQooBHj?=
 =?iso-8859-1?Q?chuqubGaC265Ho67lJXwM3uKkGc9fazZO2kb4IMW8l1TPULlJ/wt3l0ZYz?=
 =?iso-8859-1?Q?hm8Ec1d4bkyWKhEg5Wmv1Rw0v9heTbjDAX9vFobDQZ9BoemOLaejbPlZDC?=
 =?iso-8859-1?Q?EsJ0UBeJFqHuYtP1VW0VDsYghQQAIlIGIrFDdnSdcycm5lpLgaG30h1oH5?=
 =?iso-8859-1?Q?XnM9ZWzphExKDHuvVLhxwY756lAGORk9pt6buSBU5AB3K7MZlTnAzmmtkf?=
 =?iso-8859-1?Q?f3w3dOrxaKtmnWZ2G4qSV7Vw1q68CRr7Poa/jMsi1j/fHoaQ4Ek6gzkdmD?=
 =?iso-8859-1?Q?JPC/5gan5EaivG10G7LhFTwbhUFz8kyQ=3D=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(376011)(1800799021)(366013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AFdAtOgIwvvqKpijLaWLBbSEDBa563KDFrJ9bNyE/aqw?=
 =?iso-8859-1?Q?db6jeqG6rjGr6ZRPtOM=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: 19a050ca-909c-4e50-e88d-08dc9506a6eb
X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2024 11:04:58.5588
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: BlCJtLFigDwWGAEF1PZD5uASAHAZC/5HyWgXU2aYQEijf4OTyuxySq7td5EkxDKbkLJ8qgkG/Z8ztmhn0YYgYX8ALESPp9rbiB+EVFIQyew=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5236
X-OriginatorOrg: intel.com

Hello,
sorry it took me so long to get back to this. I prepared the next version with
your comments applied and Tony's replies taken into account.

I wanted to briefly discuss this before posting:

On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote:
>On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>> +		return 1;
>> +	}
>> +
>> +	for (i = 1; i <= MAX_SNC ; i++) {
>> +		if (i * node_cpus >= cache_cpus)
>> +			return i;
>> +	}
>
>This is not obvious to me. From the function comments this seems to address the
>scenarios when CPUs from other nodes are offline. It is not clear to me how
>this loop addresses this. For example, let's say there are four SNC nodes
>associated with a cache and only the node0 CPUs are online. The above would
>detect this as "1", not "4", if I read this right?
>
>I wonder if it may not be easier to just follow what the kernel does
>(in the new version).
>User space can learn the number of online and present CPUs from
>/sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>respectively. A simple string compare of the contents can be used to
>determine if they are identical and a warning can be printed if they are not.
>With a warning when accurate detection cannot be done the simple
>check will do.
>
>Could you please add an informational message indicating how many SNC nodes
>were indeed detected?

Should the information "how many SNC nodes are detected?" get printed every time
(by which I mean at the end of CMT and MBM tests) or only when we get the error
"SNC enabled but kernel doesn't support it" happens? Of course in the first case
if there is only 1 node detected nothing would be printed to avoid noise.

-- 
Kind regards
Maciej Wieczór-Retman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14])
	(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 4BDB316FF59;
	Tue, 25 Jun 2024 16:29:03 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.14
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719332945; cv=fail; b=ZnIhSxDlBlL6oX0N7EBkZ6mqpYtrPxDFkk7PHU25RhyITgl9fXR16+nJQM5jdMx2Zc/06SFOv6ZqAzSrArLMtjbpwa1rDTEw8vJI3x3D+OphIzaUgIlDWlJ9S6mR2qbir9rxfapVG7yXwr4jK/eQdNJg/0fH3oQapPndmaklgs8=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719332945; c=relaxed/simple;
	bh=8ci/btWRnhPwdtnmkeuRv9rk3RCb+KSA0faCfzrO2Tg=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=r8rRj2kMTJweUeNdOrjrIX/XdLc+/p6Ah40vluUYe6kRAA5PfGDm9N3apk0pkjC4ZNXMFj9LG3pm65mxXNOl4Z3ypoRH/J0mJwrTGkeMcE3DZGflKKH00/3KddxIZQP5V8EELkmLBTAaLdu7368LEDATebA7Op8/d1Led3Dp0jk=
ARC-Authentication-Results:i=2; 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=S2eqdG8h; arc=fail smtp.client-ip=198.175.65.14
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="S2eqdG8h"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719332943; x=1750868943;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=8ci/btWRnhPwdtnmkeuRv9rk3RCb+KSA0faCfzrO2Tg=;
  b=S2eqdG8hOaA+QAmBQmZKLiIZzwbzBLjiAicS39gXTGYiBwGWQhDZxX4p
   DYKb9HeEWLuYvn2cI/fCH1Drhk8VXF9KdLoK87ajkTdUPaDfhs+xuTgwG
   JD3pvswY1TE9Bfgq+2Lgu0yqrFo1DDe93n/cAfFokWoMntJ4Ogl1/LXEv
   SlxyNffr4f3cbrgWbuf9yGQZSRprIBVW29s3CCjvYW5B8ZLMOm04ckXY0
   My+DpFwwaEWWVuJ8qlIcxpU8KdhRbI1soLh9VzICtRSVodRMXqaUkjRs2
   RKGrbYDqzrDwlNjlR+TddSPUgBosc4UtFlYr1sWcu7n5TxPHuScPZ/Zoh
   w==;
X-CSE-ConnectionGUID: h2qr75oSTA+u4A7NfhKuwg==
X-CSE-MsgGUID: vyoYAaKTSBymKcdRvAOoIQ==
X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="20173688"
X-IronPort-AV: E=Sophos;i="6.08,264,1712646000"; 
   d="scan'208";a="20173688"
Received: from fmviesa010.fm.intel.com ([10.60.135.150])
  by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 09:29:03 -0700
X-CSE-ConnectionGUID: ENviMhgUSFiByDLm5JgqhQ==
X-CSE-MsgGUID: G4AcgG0mT9qNg2HsJbndmg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,264,1712646000"; 
   d="scan'208";a="43803214"
Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16])
  by fmviesa010.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 25 Jun 2024 09:29:02 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by
 ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Tue, 25 Jun 2024 09:29:02 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by
 ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Tue, 25 Jun 2024 09:29:01 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Tue, 25 Jun 2024 09:29:01 -0700
Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by
 edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Tue, 25 Jun 2024 09:29:01 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=NBP3miq1Y1lPysyI4bv+vc1wMcCHdZBz/k6u34rQmDd3SolBfbkfFImcuzkNEHc648zVxnaI9xNTEwUNenue8pwmxGTs9ZaQq1DBS9PhhyeuKJ2vncSzPbAh5XikEBgxSQzqbj4F671DHegfuew1fX0lyA7XV/yO202WCHSrjQmboTmhTtrsqKtRsj63RqIBOIEtyFvVRHSvZC6gLkPtH4JrjexDgEsHxzsKsZdCu9r1kwRXX5d0tjPzWX7CJKqoOM7z0hcbEndUDCuaam3V75vIfjtcG6SZYEWxTRfcZkOMmDjtV8t0ev7clKnZ49Ohq6fm+Wyo9bHpxofqfxUapw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Uqlb13wynwltNzpqF0H0M5bI6KPMCPFpMGq4OdHptH0=;
 b=gq53jhFa56LFphi2a0btKCQ1umLcTgGVlUhqB+Xhb1Sn7LLlk5s4nwTS8fTuzWVAJN3SchO7Wly+44BWXlmxs0loVNjHRf+TflEFMZutnqw4PssDedb95ZM/tp8a/GJ3UJ1NriTPVUgadJKrTFCAnpuVgmWcF98T7SastDLbWCh/6rSRF8Dm3bJfsVejXzlHtPk1HqftoZlqcZSxjuTPO2PuVuRYmOzMbhCrQFqeQGYGxNqD/WMVtnjQ1Ou41UGn2wkYBBwD6+9qd4a1ZYfZPXvnUw9LUHm4gSyc4ZaY/GCmjKnynOwIovwDFgEaWqThaebPGsTefLJRc//peYlUmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by SN7PR11MB7138.namprd11.prod.outlook.com (2603:10b6:806:2a1::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.28; Tue, 25 Jun
 2024 16:28:58 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7698.025; Tue, 25 Jun 2024
 16:28:58 +0000
Message-ID: <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
Date: Tue, 25 Jun 2024 09:28:55 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
From: Reinette Chatre <reinette.chatre@intel.com>
Content-Language: en-US
In-Reply-To: <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR04CA0350.namprd04.prod.outlook.com
 (2603:10b6:303:8a::25) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|SN7PR11MB7138:EE_
X-MS-Office365-Filtering-Correlation-Id: 91dc4244-dcda-438e-21fd-08dc9533e9eb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230038|366014|376012|1800799022;
X-Microsoft-Antispam-Message-Info: =?utf-8?B?empZUTBKNHAyQThlZjJmbEppVFhwT05jRHFJTk5IV2VKVGpZVCtUV1NvZlht?=
 =?utf-8?B?QUZjQ29BdFUzckU3QmtENnFoSXZ4a0dLZTJBQkFCTVMwR2JPTzFWZWlwS0N3?=
 =?utf-8?B?aXE0bExwai9VNXJTTDVVTFhCanIxaCt3Y012ZUNOQTNCNkR6WHZlNysrU0tM?=
 =?utf-8?B?TS9HWjR0UXhyMHFMdjJVOWxUYkxNWG1NWU5NbnhQZWxNYzc1NFByY0MwMkNG?=
 =?utf-8?B?YlQxZHBxQy9RZFRzUzVNMmI3eWtlRGh6R0NJT0xSQlBQN2RqNk9UWHkrTERV?=
 =?utf-8?B?Q1RSQWEram1HSzBSU2c1bDEyOCsyc29Pd3NsbjYxK3NHcXBOT204MDdMTDQ1?=
 =?utf-8?B?K1BNVjZRdGd0eVpaakQ4WXRXSDhFSko2a2QrbXc4bVBCQW94MlBsbzZiN0ZS?=
 =?utf-8?B?dldvQllvTUE0dWJubmNOQ2JuRnp5QjlGVlBQRGx4UXUxM01ZWmNtb3Y1OGxa?=
 =?utf-8?B?clgrSXk3bzV2MGNNZ3RFbnR0dWJ5dlZSQnF0V2pXS0R6KzFLUzR5UVNCekRB?=
 =?utf-8?B?L21ySmIrYTNLbXQxUUszOW9odDNLUnl1bytUTmRqNFJEU3Vka2ZETDRJamRT?=
 =?utf-8?B?SjZwR01PUzhUQlIrVlFtOG5KbnlWTXQ3THVNbmFBdnRHdzhJTmJtellBckx1?=
 =?utf-8?B?OHp2cmF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ld0s2T3VJ?=
 =?utf-8?B?WWEveThNU2l1dm8wcEptaUg5ekpyZFNKTUhSMDViQnBTcmNKUm1CbHRjZFlh?=
 =?utf-8?B?cGl4Kzk5T3FsRjR0SDJuOTdSOUUyZHlraDRqNDVuUVJnaEdzR1JXQUowWUg4?=
 =?utf-8?B?dWNOT29tT1B6T1VNNzgrZUlIQ1dvRTU2aVIwUVlJQzNyY2tneEJIK0lVVzUr?=
 =?utf-8?B?OVdMWi9XTkZHZ1RZSitkbi9aRGdMVmlGOUczZTErSGxaa25JL3FIbkpPMnhD?=
 =?utf-8?B?SGpQZWVGKzhWUlNrZ0JDdz09?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230038)(366014)(376012)(1800799022);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q29GekU2M2JPSURZM29xOHpxUTZKRUZHVU90eENkMm9pN1UzR1NPVll4QUhs?=
 =?utf-8?B?RFlZYVpVaDBsTklkcUJNdGg0UG52N1YzQ2F4aGVoaVo1MENpbFg4dWRwV0tu?=
 =?utf-8?B?YnArNEwwaENGNXlDK2t3V3RuWFpLRlcvaXRPYytSZ1owTDlzdTRRZTRjZjAx?=
 =?utf-8?B?VENhQ0dHQWhnOXlrU3hEQ2lMMmhxM3laTDZBNHlkMEt6VGRFRTlnOW5NVlFm?=
 =?utf-8?B?dUF0TWJmcENHMmhGMDZDeGh3YVBuU3pwYlh2a0RoekNDdzk3T2luRDYwL2dY?=
 =?utf-8?B?MTJIMEJoZk80SnVOUyt6OXhvajd5TjZHUFBCaERmd1JpQUM3cVhEcWVjVGJo?=
 =?utf-8?B?eVRWanZUL1FiU2NwWGp2c0hCSFZFT2xFQ0VSbkFXRCtWeDRkTFRjaGwyZU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DhQWm9HRVB4NVFJTTZjMlFRUlox?=
 =?utf-8?B?V1E9PQ==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: 91dc4244-dcda-438e-21fd-08dc9533e9eb
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2024 16:28:58.1251
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kWdUWffvhHV4CKpmEck9nWGJqJU0DvwOeOkXdJS4EC8x/08Dby7xTnts5TvcKvY7FZVk4xc9yq8jqyzY4/S0Z3y4cjGPk19jS3DfoNKlCkU=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7138
X-OriginatorOrg: intel.com

Hi Maciej,

On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote:
> Hello,
> sorry it took me so long to get back to this. I prepared the next version with
> your comments applied and Tony's replies taken into account.

Thank you very much for sticking with this.

> 
> I wanted to briefly discuss this before posting:
> 
> On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote:
>> On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>>> +		return 1;
>>> +	}
>>> +
>>> +	for (i = 1; i <= MAX_SNC ; i++) {
>>> +		if (i * node_cpus >= cache_cpus)
>>> +			return i;
>>> +	}
>>
>> This is not obvious to me. From the function comments this seems to address the
>> scenarios when CPUs from other nodes are offline. It is not clear to me how
>> this loop addresses this. For example, let's say there are four SNC nodes
>> associated with a cache and only the node0 CPUs are online. The above would
>> detect this as "1", not "4", if I read this right?
>>
>> I wonder if it may not be easier to just follow what the kernel does
>> (in the new version).
>> User space can learn the number of online and present CPUs from
>> /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>> respectively. A simple string compare of the contents can be used to
>> determine if they are identical and a warning can be printed if they are not.
>> With a warning when accurate detection cannot be done the simple
>> check will do.
>>
>> Could you please add an informational message indicating how many SNC nodes
>> were indeed detected?
> 
> Should the information "how many SNC nodes are detected?" get printed every time
> (by which I mean at the end of CMT and MBM tests) or only when we get the error
> "SNC enabled but kernel doesn't support it" happens? Of course in the first case
> if there is only 1 node detected nothing would be printed to avoid noise.

I agree that it is not needed to print something about SNC if it is disabled.
hmmm ... so SNC impacts every test but it is only detected by default during CAT
and CMT test, with MBA and MBM "detection" only triggered if the test fails?

What if the "SNC detection" is moved to be within run_single_test() but instead of
repeating the detection from scratch every time it rather works like get_vendor()
where the full detection is only done on first attempt? run_single_test() can detect if
SNC is enabled and (if number of SNC nodes > 1) print an informational message
that is inherited by all tests.
Any test that needs to know the number of SNC nodes can continue to use the
same function used for detection (that only does actual detection once).

What do you think?

Reinette


From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11])
	(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 B2EE6ECF;
	Wed, 26 Jun 2024 07:10:14 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.11
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719385817; cv=fail; b=PmtmV1nYPvMM2bbgq8dgMSrUlqxgYSN448Q6WCjroNDWE2x3apiZiBXeshdzQH4PgOXMmUwYqWAH/TyC1EDd+xP0P9kNjFNM2US9tAk+Xt0UaXOedFVkyQSI7Z4Xgpa4w/JZyKsV7Zfh3DuawlGHUNjnTWZUWBDBROsPy7vnrVA=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719385817; c=relaxed/simple;
	bh=RujmQsstKfwyB6cKbkjbhAN/tLNxHRgXVLyHctvhEMg=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=lF6OIb5hlzCk/rRxO631+72bDUE6h7x6S4a8SvYEcTfg//B8kjEZyXvXcshMBabQb29RCivMcn2kHmzT4we5G79nWz1RUcpQ3pOJzSYz3XOB0E9H0KWcY43WzYB5Ai7Gsa2Eo5H7FfKiTpF58FgCLX8Q3h/MafdU34KjaNHVQLE=
ARC-Authentication-Results:i=2; 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=Aw3WdLzu; arc=fail smtp.client-ip=198.175.65.11
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Aw3WdLzu"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719385815; x=1750921815;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=RujmQsstKfwyB6cKbkjbhAN/tLNxHRgXVLyHctvhEMg=;
  b=Aw3WdLzuK7K/R4HOFcGRrWVzYUXJTzpWczF0sM+8YYBwQYwiDjeFsnDj
   o6Vjo60ns6MpD6zwaJ6jt+TxU0YlnDMGswssxnkcvHdfLXz4BxmifQztV
   yCz2RsFhj27FGvSJTQGnGtgFRQwfkCLSNM7DNKYqGUbnboDSzI1P/4vAF
   nsz75OtWj2qTUfJf8cEWg4zM35tiVeMvOa9XlqalGcj800XH8wz783+u4
   /0wf/dJR2UonYWW6wxtjN4KEtHfLVBQNRXURBwu4lTIRIXjxowdP47K2b
   6Whp8eMN7osLsP3Fz1gufgjwW5cvuFPhFS9AWsMhPOZlUeYfI4fFH57DX
   Q==;
X-CSE-ConnectionGUID: K2bgoGW/TYKQN89hCybUtw==
X-CSE-MsgGUID: /TX2Opg3QHSCVh2yAUJQDw==
X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="27030034"
X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; 
   d="scan'208";a="27030034"
Received: from orviesa001.jf.intel.com ([10.64.159.141])
  by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 00:09:58 -0700
X-CSE-ConnectionGUID: 0Z+TM6InQM6D7xpKgdoIRg==
X-CSE-MsgGUID: 2+Z7CGwfSsOeg/6WEvjtzA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; 
   d="scan'208";a="81441447"
Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15])
  by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Jun 2024 00:09:58 -0700
Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by
 ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Wed, 26 Jun 2024 00:09:57 -0700
Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by
 orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Wed, 26 Jun 2024 00:09:57 -0700
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168)
 by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Wed, 26 Jun 2024 00:09:57 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=H3G2jgJ8l+CVmI7pI2vI+AvV6T+d9AUIIICvhz2oH7lFhz11h+51IYmXN8xZv6cOt7VnhQK9DRBAAeUUm8jvhMEcvsA9zEQqVLUA6MEkWbbnJLnr7L+tRvP6VVZo6LFGeXpOuTeGO8zlHqevF1atEqX/QMb8S8bJZiJ2skegdlsY4VL1b9Pz5+KSTaqqBabnw7XVPf+Jw8sy75ZxoI5TIEzBCme/m9v+4R/CCLtuN3LyhUdD72S1O4QPWo8buutMadVkne7409T0zlBf+UMwz/zpNLhLBCMwHCyGrjA6XkKtyXwAYT1rIOM6+35rIvk5h+iP1Ahiw9n8CK8Mprf7xw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TvgpgVxERZ4wssKvLVswIbRWnuHQyIEAblebyhurUgc=;
 b=BWHfRMe4Jdw5PZJOM0SIamte8Wsk87OvLzkm8tc8GtDnkZjZKLc5l3aokRanmgY4uWerWGGEr/EpmlA9rwfV6hSSThLIOgLeHkqp3JJC6JhJ1273mOYf1MMtdsQcuglbXZVa4+AcSgBIBUXPz0/z0nqVBHrboqLWEFJUrKn6sQrFYR/fzxjygtsIyFjBqveOfICrnAY2UgCJU9CFCT8Q29OElxMtgtJjr/HE6Z77B9MXLXd9Z6k47bwxsRI+JFHB8KwLM2ef/b7QyOj3xqUnD9Xpeh9urF/0h003XmW7FKDvqI4YpZhmnM8F48bj6aqdKtX25OETGoQ7jrnlsCExMw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by PH8PR11MB7023.namprd11.prod.outlook.com (2603:10b6:510:221::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Wed, 26 Jun
 2024 07:09:55 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7698.025; Wed, 26 Jun 2024
 07:09:55 +0000
Date: Wed, 26 Jun 2024 09:09:37 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Message-ID: <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
 <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
X-ClientProxiedBy: DB6PR0301CA0091.eurprd03.prod.outlook.com
 (2603:10a6:6:30::38) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|PH8PR11MB7023:EE_
X-MS-Office365-Filtering-Correlation-Id: f4b0f2c7-d3fc-4422-876a-08dc95aefa98
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230038|376012|366014|1800799022;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?yKH3AivFj7FCbGKPRTO6xsCXTO+8TP7ig3/0tBpm3m9EGsPG0RTQmtKcLU?=
 =?iso-8859-1?Q?7xPB0CAjtLjzC2iJtjPyuBFdML4BNiz8vGbuSXGefPzbCdStqay2ff6F9/?=
 =?iso-8859-1?Q?w4WMm8G+lmKa536s5a77Z+jBwxSYbxqTzx2XzZEqilDkme0bs6VqtyxA/U?=
 =?iso-8859-1?Q?1h8eSUjRg3em97eQyYDpgZlmMk6+ICxBd17GQ6/TqMxz9pF2+zFIurIjvI?=
 =?iso-8859-1?Q?yxwcxXknk11c0LpHLtSWblH6VafjEWyM6TWP6zh0ZnQox6tNDRhKbbVOqp?=
 =?iso-8859-1?Q?G2Q6fHsL+dKT+MqipBsiHlfq+5QIKHv44C9+HlHqwAw/40C04kSIb0DPoM?=
 =?iso-8859-1?Q?NijRYUkTbQJtfIAWcrRT/OMe3N049RbrxmIrLvfEyGEFX+ThLo3+03EhUt?=
 =?iso-8859-1?Q?OTR+qXNi1xxuoPZcYUA7VNVinLDBasPp3cl9R2+40ieilNHeMUK0ET530x?=
 =?iso-8859-1?Q?NUpvSc9bZh0hp3BQ8GnIPux0etTwkai05Vu/QFmcrRqiHcCjxsYIvVt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2feV?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230038)(376012)(366014)(1800799022);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?45q2V9cMAAt2wmKS7qfgSvgCEc1+aWEyp9F1vllPYPohhpgqqNmkBbFLCM?=
 =?iso-8859-1?Q?Qub4dfJZPlRQpf3Q+SB0hx3rkJL6tUK36/MjJaOO84gCWYS/1k20DBk/KP?=
 =?iso-8859-1?Q?HS8K+Rq9NJ6QaL5o7cVZZzlN2RU3oGiLH7J3j7vccA0nyPU7Vj1fytS5s7?=
 =?iso-8859-1?Q?Ome/vmcZZ3pWgR11K8vZUf5/dQccCHeSIdfcGRZeepRHFDMdLZdyf94LiV?=
 =?iso-8859-1?Q?XCKfmc5up08vFCIBEzBGYz4KOR+332JwJA17i13Nm6lIy4VanuF6pyN6B/?=
 =?iso-8859-1?Q?n/yuIV/EInlq0ArPm5X45BMdk56V3pvmF9zJHAopuOeHJ2bdLcAOhQlzBi?=
 =?iso-8859-1?Q?p1cehVba4ayyNIcwJ4jchOH+tWf1YH9bmjI+uQMrm1uia3XJCGNYtgD/4w?=
 =?iso-8859-1?Q?y87DOARakmykFX5g/uKiI3ObIaaMngWWj04DvcdhSYq4JFSykgzA/EDjaB?=
 =?iso-8859-1?Q?sbn+20j0nlcV9VSNWmOHphHsjQZVwtpU5boLsL/3I+y5erCsApSjkLVOOT?=
 =?iso-8859-1?Q?kgOnnma7yFxTlMEKHVbXsSA8Z6cu+5TdbnqiJxkKA4eoL8Ug9wsXeXKmie?=
 =?iso-8859-1?Q?kDfU+uqQVtXYd1e05ofH2TMLcyksn5yPhpzu/sg3saaoqmIAN7S6L2ZIGH?=
 =?iso-8859-1?Q?hjOCppQ96mmG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NCT95UTyUwpoxBVjTiKiluJN8150APDMyVU?=
 =?iso-8859-1?Q?tibatQG3H1lYQ8ngyFgxyHzqXNzB13LZ+0br/dqJQIDjmNaKpPczLZwK1p?=
 =?iso-8859-1?Q?193PyW1ceApeTKZ5JdMy/EidzbSB7BTopcPxm4YvzfUWQnkr181j1+71fW?=
 =?iso-8859-1?Q?JwudiK3uvRN+nKSZT1k=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: f4b0f2c7-d3fc-4422-876a-08dc95aefa98
X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 07:09:54.4331
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 5hMMO1OJ4eGHW7p5mcABVaBufXVhI23pga42SC7m7Dsdyo32muSliSuNL65X9UeJ/QF40SF2jNOVO7pM4G2UFqnKoyFbuJpppS238oS5eiY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7023
X-OriginatorOrg: intel.com

Hello!,

On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote:
>Hi Maciej,
>
>On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote:
>> Hello,
>> sorry it took me so long to get back to this. I prepared the next version with
>> your comments applied and Tony's replies taken into account.
>
>Thank you very much for sticking with this.
>
>> 
>> I wanted to briefly discuss this before posting:
>> 
>> On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote:
>> > On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>> > > +		return 1;
>> > > +	}
>> > > +
>> > > +	for (i = 1; i <= MAX_SNC ; i++) {
>> > > +		if (i * node_cpus >= cache_cpus)
>> > > +			return i;
>> > > +	}
>> > 
>> > This is not obvious to me. From the function comments this seems to address the
>> > scenarios when CPUs from other nodes are offline. It is not clear to me how
>> > this loop addresses this. For example, let's say there are four SNC nodes
>> > associated with a cache and only the node0 CPUs are online. The above would
>> > detect this as "1", not "4", if I read this right?
>> > 
>> > I wonder if it may not be easier to just follow what the kernel does
>> > (in the new version).
>> > User space can learn the number of online and present CPUs from
>> > /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>> > respectively. A simple string compare of the contents can be used to
>> > determine if they are identical and a warning can be printed if they are not.
>> > With a warning when accurate detection cannot be done the simple
>> > check will do.
>> > 
>> > Could you please add an informational message indicating how many SNC nodes
>> > were indeed detected?
>> 
>> Should the information "how many SNC nodes are detected?" get printed every time
>> (by which I mean at the end of CMT and MBM tests) or only when we get the error
>> "SNC enabled but kernel doesn't support it" happens? Of course in the first case
>> if there is only 1 node detected nothing would be printed to avoid noise.
>
>I agree that it is not needed to print something about SNC if it is disabled.
>hmmm ... so SNC impacts every test but it is only detected by default during CAT
>and CMT test, with MBA and MBM "detection" only triggered if the test fails?

Yes, snc_ways() ran before starting CAT and CMT to adjust cache size variable.
And then after CAT,CMT,MBM and MBA if the return value indicated failure.

>
>What if the "SNC detection" is moved to be within run_single_test() but instead of
>repeating the detection from scratch every time it rather works like get_vendor()
>where the full detection is only done on first attempt? run_single_test() can detect if
>SNC is enabled and (if number of SNC nodes > 1) print an informational message
>that is inherited by all tests.
>Any test that needs to know the number of SNC nodes can continue to use the
>same function used for detection (that only does actual detection once).
>
>What do you think?

I think running the detection once at the start and then reusing the results is
a good idea. You're proposing adding a value (global or passed through all the
tests) that would get initialized on the first run_single_test()?

And then the SNC status (if enabled) + a warning if the detection could be wrong
(because of the online/present cpus ratio) would happen before the test runs?

On the warning placement I think it should be moved out of being printed only on
failure. I did some experiments using "chcpu" to enable/disable cores and then
run selftests. They didn't have any problems succeeding even though SNC
detection detected different mode every time (I added a printf() around the line
that cache size is modified to show what SNC mode is detected). While I
understand these tests shouldn't fail since they just use a different portion of
the cache I think the user should be informed it's not really NUMA aware if the
detection was wrong:

(this was a 2 socket machine with SNC-2 and 55296K L3 cache size)

This is without any changes:
	[root]# ./resctrl_tests -t CMT
	# dmesg: [   11.464842] resctrl: Sub-NUMA Cluster mode detected with 2 nodes per L3 cache
	...
	SNC NODES DETECTED : 2
	# Cache size :28311552
	...
	# Average LLC val: 12413952
	# Cache span (bytes): 11796480
	ok 1 CMT: test

This is with all cores on node 1 disabled:
	[root]# ./resctrl_tests -t CMT
	# dmesg: [   11.464842] resctrl: Sub-NUMA Cluster mode detected with 2 nodes per L3 cache
	...
	SNC NODES DETECTED : 1
	# Cache size :56623104
	...
	# Average LLC val: 22606848
	# Cache span (bytes): 23592960
	ok 1 CMT: test

And this with one core on node 0 disabled:
	[root]# ./resctrl_tests -t CMT
	# dmesg: [   11.464842] resctrl: Sub-NUMA Cluster mode detected with 2 nodes per L3 cache
	...
	SNC NODES DETECTED : 3
	# Cache size :18874368
	...
	# Average LLC val: 7382016
	# Cache span (bytes): 7864320
	ok 1 CMT: test

CAT also succeeds although it reports bigger or smaller cache miss rates than
normally:

SNC NODES DETECTED : 1 <-- all cpus on node 1 offline
# Percent diff=12.7
# Percent diff=10.2
# Percent diff=7.8
# Percent diff=6.7
ok 1 L3_CAT: test

SNC NODES DETECTED : 2 <-- real
# Percent diff=49.6
# Percent diff=37.8
# Percent diff=22.4
# Percent diff=16.0
ok 1 L3_CAT: test

SNC NODES DETECTED : 3 <-- one cpu on node 0 offline
# Percent diff=76.6
# Percent diff=53.3
# Percent diff=35.1
# Percent diff=28.9
ok 1 L3_CAT: test

>
>Reinette
>

-- 
Kind regards
Maciej Wieczór-Retman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10])
	(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 A5FC118F2EE;
	Wed, 26 Jun 2024 16:46:08 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.10
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719420370; cv=fail; b=ZrOQqignEmKSNiQ4sGmKRwMoJaGWQNcKmZPwPY5AHwI7/27E2iSsrGt0YXPSeGYhPsoIJ2QXwRK+m4wIh/6bHsjyHwru9ZmSmK1RJyGPDt3EbAZzy+jnh0mIyAkJQZdoGJyGlySCHvHlvIHN/2aAMp08YeOrFaqqQl1txXKkha4=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719420370; c=relaxed/simple;
	bh=/KpWss3Qken5HHyyywxW3xXGix2HItUz96bHtnaU5wE=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=RyKaTM5P3WzSjFfe9/3XTsP+ZAsW7eOoU+xJLHv7g6YScDGcWo0/fDbYsDW19S/jnviv1KiySltsg7TF1r7JSSjL5NUmdpvFi59X+IlGhjXYWVJoXWRDnrB3dAXPHTRdrSfv/j40jHxE+1/OouKDYHhwsNy42sfT7g2etAxEJms=
ARC-Authentication-Results:i=2; 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=BLS9CXsN; arc=fail smtp.client-ip=198.175.65.10
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BLS9CXsN"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719420368; x=1750956368;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=/KpWss3Qken5HHyyywxW3xXGix2HItUz96bHtnaU5wE=;
  b=BLS9CXsNn5SpVksktEdoe4DtZ5/YMMKsRubC/9ZeEndlPHjlFj2U8Q/r
   P367FsQ5rQZ4BZ0Vsud8Owgg/GjacncZ7hIf8dMpIs292aRUSF+S9Ssto
   Cemo1UiSKkXqisXn2PPA6GBZevFyCiASDVlFmvQpLVNmq1Re+YO/aOo57
   TCgIG0eKjOQIQz3+cKWxBImI6GRGMWkuZm3cq1QZUXO17YGhjYfTD0nRc
   UIYGlYxwCquy1H8k9DP87/0BA3PhR079YtIJ6Xn4vywvtW+SvfDl24rWE
   NB+IEpVdJnAbsurPG+6XrJTcv0w7S61syc7xamc+AylCoSJ+Znmu5bdue
   g==;
X-CSE-ConnectionGUID: 8FfAbRn8QIee2Sx1iTs5lA==
X-CSE-MsgGUID: /GE3UMhnTyyFqUGP05Zfnw==
X-IronPort-AV: E=McAfee;i="6700,10204,11115"; a="33961202"
X-IronPort-AV: E=Sophos;i="6.08,267,1712646000"; 
   d="scan'208";a="33961202"
Received: from fmviesa002.fm.intel.com ([10.60.135.142])
  by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 09:46:08 -0700
X-CSE-ConnectionGUID: VfL05s4QSrqVeBO4fQ02/g==
X-CSE-MsgGUID: +/asmKLYSyqeBVlYRbDXbw==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,267,1712646000"; 
   d="scan'208";a="67283956"
Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81])
  by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 26 Jun 2024 09:46:08 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
 fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700
Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700
Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by
 fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Wed, 26 Jun 2024 09:46:07 -0700
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169)
 by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Wed, 26 Jun 2024 09:46:07 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=d8htTn3TCiou+2gqBG1ePr3JUeV9ltahwNU7HBXgXpdUZd3uNu+fdhttI/d3fDWxeGE3EHV/ZX5OfreD/wgMeAGocxAlDQyIGCRaHgu5Lmvh7ExvdKDZPKkxTGPJao0adTvJG0iNLg3EOom1y1lfwlk39lMm3EwgIYn45PS16gaLTzYonA3Wr+gLskB3XmBVD/uLqUqfRD08riE3HXCaFwxVIV31jZaDSFLsXwFSfSXOZM+bKbBKaxCX6v4Ifl4hpfcbi9Huv0uwqhAc+/1lvTmAzBMS/mCQxT2FjTOMzWp45yFivjE/qyo8nDkNfzmNvawVzdnaioQLy+OP31oztA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EnYrBIEO6oJH1DgRzsfX+Oq2t27TPFlS7ZrcuLlY2kE=;
 b=oWnMA0LqlyMv8bUTDxmWtF4X0Z4GbZ6EP0mWtTgxu/PXKyTb7Ua78QPyS8UddeRKABgewVGri50mfXVOgkHH4jRMZwvCsNWMSd3NQVsg9EhwoZFOC2Ozz8agWKuQJ64Lax7EFr8s9KqS10jiVb+ok15p0nrT3R5587HbuDbkZpBFAjfH13t9XMRKGW5h9US6QthcldkymL0qwOMUo8gVhuyuLTXLLX6nbxPzQfeoXPbyAxsSv0Xhq+rbqt6DgbrdBP0SHJXKXez41QI3//VojkT/7A0wTf5ulldKvZXLRjtF0VOrxbxcauH1JVnEJ2AazJ7demnz5I9Db/fjLf0G7Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by CH3PR11MB7895.namprd11.prod.outlook.com (2603:10b6:610:12f::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.34; Wed, 26 Jun
 2024 16:46:04 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7698.025; Wed, 26 Jun 2024
 16:46:04 +0000
Message-ID: <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com>
Date: Wed, 26 Jun 2024 09:46:01 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
 <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
 <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
From: Reinette Chatre <reinette.chatre@intel.com>
Content-Language: en-US
In-Reply-To: <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4P222CA0006.NAMP222.PROD.OUTLOOK.COM
 (2603:10b6:303:114::11) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|CH3PR11MB7895:EE_
X-MS-Office365-Filtering-Correlation-Id: cc16ef0f-9415-4121-8c7d-08dc95ff77c2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230038|376012|1800799022|366014;
X-Microsoft-Antispam-Message-Info: =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efront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230038)(376012)(1800799022)(366014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDc4RkdiV05VSWFSdHJHdHRhMlh0WTVvQWxvZWoyOXh6cUpPa3B4djFuY1JN?=
 =?utf-8?B?UGw0Y2QxZTZ2TFBiL3VxbWNUQzg5RVlUSWdZaGVXOHRXQkdFa2E1VjcwcHFr?=
 =?utf-8?B?emNxSVo4OFo2MVU5MkdQaEprVWlIZDM5SkdSSTh5d00yaFNMK0VoRVR6NW50?=
 =?utf-8?B?d2hFMml1UmkvRHlMTDhZbVNUUTY4aHF3NVRiM3BQYUhNeTFhckk3QWlYVDA4?=
 =?utf-8?B?REUrTkhnMklVNE4rQXhRNVFkalo3VEtIVTMvSit4amcwbk5WZXVIM2Vwcis4?=
 =?utf-8?B?Wm9FdmROZTN2c3BWQnE3a1Zkb2tTaEpXcGxNODFvYUorOWlNdlNJSFJYakpi?=
 =?utf-8?B?dWpWemVkQ0lhbXA3YlJwcEVQRVpIdmp0eDZ3Ni9yVXlFVThta3gwbi9vQkVU?=
 =?utf-8?B?RFFNclhwNzM2MHN4bFNwYkpjTU01MTNISXJONmRtbWdSWVFyTHFrdlZxZFg1?=
 =?utf-8?B?bStnZHJSajloV21UQXN0UmdkQzZOc01KRE95ajRVZDc0Q3NseWMrUWZ3VXFh?=
 =?utf-8?B?d1BJQlhDR2RpaHdZZDgxLytNU29xMjZSTXFRYkdwbm5FV3BCUUl6WTk0ci92?=
 =?utf-8?B?NUpUZm9FcEtkcVFQdVQ4d0JNSDZRRi96NG05bzcvSHNxZ0pMZVdCMUxOUS9v?=
 =?utf-8?B?dTFqaVlIbUMzakU5R2hjbDhFTlZ4cC95NWhsdzB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8?B?VjZ1SGNnZnR2WldUN0g5TlZUeFBWQXB1Vk1JeHJjSkp4Y3VjRk9IWmREN3hx?=
 =?utf-8?B?SXNjalVUMzllNGlLaUdYaUFxeEtiNFhrNFFsM2Z0Lyt6TENRZFpPZ0NYRE40?=
 =?utf-8?B?S2taRmJHWEFtZi94UnlYTEZ2ZDVudE1xNzNiL3NDVFV4OHZ0NnVCRDBVTUtE?=
 =?utf-8?B?OGJOOEovdUIvVmlzYjBKV0lUTjlrUnRnVlFlTTB5NnRrR3VSZnpzRG5uKzlh?=
 =?utf-8?B?c04wT1ZFVHNNQW9SK3ZJWkZNQnBoNW5nenlsekhSUzZCc1AzUlJnSVZIZmgz?=
 =?utf-8?B?aXN0Q1F0UjBRNXZxUXJUZ0xhVGlZeWdyT2MvUVUzZTNVRG8vaVlKMkVEbFMr?=
 =?utf-8?B?SENDR1FQUngyRkxWWFg1ZHNsWnhOL2diV2cwYjBFYXdrMFNKSHJhRVBhSWlD?=
 =?utf-8?B?eStudjFJUG80b1owVllpbmgrQ2NaYllkbmEwY2wyaXNJT0F6bXJPWnIvVnlV?=
 =?utf-8?B?aXc3U09tS0ZWdlhRbjJWYW8wVXEwUm4yTkxBRUQ3c0pFRkM0WEdjemdGQ1Yr?=
 =?utf-8?B?NXV0TVVvTDgzQ2xqSUpLWE4yMlNsV0hIKzFJOGhld3JGNU00d05QTERjek1Y?=
 =?utf-8?B?ZUE9PQ==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: cc16ef0f-9415-4121-8c7d-08dc95ff77c2
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 16:46:03.9700
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: X35lsgTWNEjd3eYjev7UCfS6n+2gQ1YDa6+mIPFNuZnUNJ5zMxU/uez3NwGMfQV11OgzAbMJSmyhBuBOaNupnArcjL9Pgms/deKuwYsY9f8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7895
X-OriginatorOrg: intel.com

Hi Maciej,

On 6/26/24 12:09 AM, Maciej Wieczor-Retman wrote:
> Hello!,
> 
> On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote:
>> Hi Maciej,
>>
>> On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote:
>>> Hello,
>>> sorry it took me so long to get back to this. I prepared the next version with
>>> your comments applied and Tony's replies taken into account.
>>
>> Thank you very much for sticking with this.
>>
>>>
>>> I wanted to briefly discuss this before posting:
>>>
>>> On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote:
>>>> On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>>>>> +		return 1;
>>>>> +	}
>>>>> +
>>>>> +	for (i = 1; i <= MAX_SNC ; i++) {
>>>>> +		if (i * node_cpus >= cache_cpus)
>>>>> +			return i;
>>>>> +	}
>>>>
>>>> This is not obvious to me. From the function comments this seems to address the
>>>> scenarios when CPUs from other nodes are offline. It is not clear to me how
>>>> this loop addresses this. For example, let's say there are four SNC nodes
>>>> associated with a cache and only the node0 CPUs are online. The above would
>>>> detect this as "1", not "4", if I read this right?
>>>>
>>>> I wonder if it may not be easier to just follow what the kernel does
>>>> (in the new version).
>>>> User space can learn the number of online and present CPUs from
>>>> /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>>>> respectively. A simple string compare of the contents can be used to
>>>> determine if they are identical and a warning can be printed if they are not.
>>>> With a warning when accurate detection cannot be done the simple
>>>> check will do.
>>>>
>>>> Could you please add an informational message indicating how many SNC nodes
>>>> were indeed detected?
>>>
>>> Should the information "how many SNC nodes are detected?" get printed every time
>>> (by which I mean at the end of CMT and MBM tests) or only when we get the error
>>> "SNC enabled but kernel doesn't support it" happens? Of course in the first case
>>> if there is only 1 node detected nothing would be printed to avoid noise.
>>
>> I agree that it is not needed to print something about SNC if it is disabled.
>> hmmm ... so SNC impacts every test but it is only detected by default during CAT
>> and CMT test, with MBA and MBM "detection" only triggered if the test fails?
> 
> Yes, snc_ways() ran before starting CAT and CMT to adjust cache size variable.
> And then after CAT,CMT,MBM and MBA if the return value indicated failure.
> 
>>
>> What if the "SNC detection" is moved to be within run_single_test() but instead of
>> repeating the detection from scratch every time it rather works like get_vendor()
>> where the full detection is only done on first attempt? run_single_test() can detect if
>> SNC is enabled and (if number of SNC nodes > 1) print an informational message
>> that is inherited by all tests.
>> Any test that needs to know the number of SNC nodes can continue to use the
>> same function used for detection (that only does actual detection once).
>>
>> What do you think?
> 
> I think running the detection once at the start and then reusing the results is
> a good idea. You're proposing adding a value (global or passed through all the
> tests) that would get initialized on the first run_single_test()?

I was thinking about a solution similar to get_vendor() that uses a static local
variable. A global variable could work also.

> And then the SNC status (if enabled) + a warning if the detection could be wrong
> (because of the online/present cpus ratio) would happen before the test runs?

I do not think this was part of previous tests, but yes, this is a concern where
a warning would be helpful.

> On the warning placement I think it should be moved out of being printed only on
> failure. I did some experiments using "chcpu" to enable/disable cores and then
> run selftests. They didn't have any problems succeeding even though SNC
> detection detected different mode every time (I added a printf() around the line

I am not surprised here since there has not been much tuning of the CAT test.

> that cache size is modified to show what SNC mode is detected). While I
> understand these tests shouldn't fail since they just use a different portion of
> the cache I think the user should be informed it's not really NUMA aware if the
> detection was wrong:

Seems like there are two warnings to consider:
(a) SNC detection may be wrong.
(b) If SNC is enabled and kernel does not support SNC then the tests may fail.

For (a) I think that it is possible to know when SNC detection may be wrong. A test
similar to the kernel test that compares the "online" and "present" CPUs [1] can
be used. The /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
files are available for this. A simpler way may be to just print a warning if
/sys/devices/system/cpu/offline is not empty and set the number of SNC nodes
to 1. Instead, a new "snc_unreliable" global can be set that can be used
to print additional information during test failure.

I do think that it is fair to print all the SNC details during detection but
I am concerned that those messages will be out of sight during test failures
and I thus do think it is useful to have extra information during test
failure.

Reinette

[1] https://lore.kernel.org/lkml/20240621223859.43471-18-tony.luck@intel.com/

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18])
	(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 C73CF7D3E3;
	Thu, 27 Jun 2024 09:51:49 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.18
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719481911; cv=fail; b=RAkT8PxYe2YZ2IRTy4L6LlYbCMwGEUe7MyBMcKL6rR/M3fmd2nFRIN0ivfeOMB5TjIxfmI5Vfz5MKB1PdcUCSmvTMzfP2FfJawGL/4ELwcgwFiODPVCtzV2zFxR+WMQBc/hAtocvQlrb5uJ9NPW5T25/n5+dl3YSq4Qbq/fz2zc=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719481911; c=relaxed/simple;
	bh=B9GbTfwhxWlarNIEhZVom+9Qwsu3Xx9dXeTlxmox1Jw=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=J4NUHeexqM0LHh7xPT02vL6uUJ+ibdmI7gbt3TXFguv741STBL7BuJT1Sj/pS0kpJ0km8NykahmxKi/dJlrVuV6cejaZ/Fa1ZJFtyoufoPk9Gqfh1POu8HcwMPSIz7NbZY43A9FtG2Z1YMNPOLuI6Viep2yaM7i8LzR910JnAAg=
ARC-Authentication-Results:i=2; 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=Ylz/Bij7; arc=fail smtp.client-ip=198.175.65.18
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ylz/Bij7"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719481910; x=1751017910;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=B9GbTfwhxWlarNIEhZVom+9Qwsu3Xx9dXeTlxmox1Jw=;
  b=Ylz/Bij7+w5SluFEHwdOkn2I8H6I8zPgHyuKz512E+KhWF9FgNbrc9KB
   3X2FuhIryUgyOjVfO3MayELIGWC3nWYzPmn95MyJiIVNS+O00q28mr/Yh
   1QsMTG7wmskE5g/fAmyZ9WLJMaHhLzXoOYuHx1CUVg+kUVVSZcL8mYe8H
   5akGGBLo249kWpPalqR0qwnkhQyWveaiGWzyZbFnD9Bj8h8SX6qgj7BEz
   Pz5wp227cOJ7a8q9hRs9tkhrpxtK599OdA+GWpQgdPqBfoE3C0nUkaMd+
   Q5Q/F83BDggLCleY3PS5IN5+QDNrfBXGqa7MC6h6T1LmzxZmNIRfNNJOU
   A==;
X-CSE-ConnectionGUID: NE88udwvQcanFiEShFMDNw==
X-CSE-MsgGUID: dPtfpbKhT/CpIgTyOAJgPg==
X-IronPort-AV: E=McAfee;i="6700,10204,11115"; a="16744512"
X-IronPort-AV: E=Sophos;i="6.08,269,1712646000"; 
   d="scan'208";a="16744512"
Received: from fmviesa004.fm.intel.com ([10.60.135.144])
  by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 02:51:49 -0700
X-CSE-ConnectionGUID: p0m3mkcnSOyhiWHjx8sAjg==
X-CSE-MsgGUID: iDKf2zLWS1iTLjywk7IxLA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.08,269,1712646000"; 
   d="scan'208";a="48927049"
Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82])
  by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Jun 2024 02:51:49 -0700
Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by
 fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 27 Jun 2024 02:51:48 -0700
Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by
 fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 27 Jun 2024 02:51:48 -0700
Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.49) by
 edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 27 Jun 2024 02:51:48 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=I5mF8d9w4kIn4xyD0iEaYy85WGRXH3d2TqTBWJZLov7zzoDqxbfW4Xh0AFYp++y8zmER8M0VbaKC+UA02XScHynxEwNWuu8jn1GsqZw5T7qPXpSG14QbdDdZEexcZ5aj14lw3zWh05GbglAqZyBiAZRtxwZAiGw2l1eVg9KTUX4LYG8OaprJaronnrlV343x9J6RfQY/Zy2eRmG7m6exf9dRg9syqsRFjb0bl2lHKFSOyqs8cOCEsE2Fq1p3OBeW3WR3pNAncubr/GsXNawaedlLECt7C2b7gLoecHWQZH3ZOIOk7MxModso5OH8/6dw0bw3DGrEEPd15PK6wnQ09w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=dAfURUop+RO+MePSN7hrgvGjjWpg794ZiticO/dktdA=;
 b=hJVVr6I0ROZey1QJ35Ho9P9hcNq/FNkYik/KCxLgiZoY9uyFgmI9pLyIT6w9lcw3Au/CbX7+yEUn0RJd3juLVVUSCbWmJBGgMigvGprp9FsM29OF5ZnMHT8QEcPaOLnpxy6miWulf5asnDl6r+qoY34TcgoBSUDu/rtun/jjES8OPB3hZPFWYB8Of4M4N7TBrFUh5m3s2BT9DaO36sJzVri9ZZeSp26/chGhLGet5lig0PIYBQxHLJuwflAXIdTKViSKJqYDp4QLKFjwQoUXH3U85lMRPVZS+1+Z6IDdU2ruznwE2kJvSRriIQA9jYjL0PncS6WjaRo/0U7CwEg2Ow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by DS0PR11MB6398.namprd11.prod.outlook.com (2603:10b6:8:c9::6) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7698.35; Thu, 27 Jun 2024 09:51:46 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7698.025; Thu, 27 Jun 2024
 09:51:46 +0000
Date: Thu, 27 Jun 2024 11:50:49 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Message-ID: <ewkiaarsl4s4aofw2uykhup3eyutnzitlow3muzbaqqf4xp53g@6lgc5o2dkmor>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
 <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
 <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
 <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com>
X-ClientProxiedBy: DB8PR06CA0036.eurprd06.prod.outlook.com
 (2603:10a6:10:100::49) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|DS0PR11MB6398:EE_
X-MS-Office365-Filtering-Correlation-Id: 4b86d586-fb0c-468d-8f5b-08dc968ec1a9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?/0qM1iWF8Yyxu4edRMUyDam8Rb0ny+eS9JKq43rBBq8CRE8ZqyERCuAJfm?=
 =?iso-8859-1?Q?W0CESvzKCq6y0rwGi0RxZgVsPgPnkgYIQoW3w06zghN68bA4zlNx+XQSw1?=
 =?iso-8859-1?Q?XKGlAgJpWZT9eINjTIiA8mRhfT32jZSOLkS7eH763TUSKO9iCpG0wkc3PF?=
 =?iso-8859-1?Q?+8pLNqiTofSnZSBSqmdmYE2XU/YPD3YU3Ad9ETDGFM7I/lxymmhdL/IrZ3?=
 =?iso-8859-1?Q?eBlq2nX2Uu+WOWQpZy03Yynyqh58e5ItmLdCiTBCwUe0GoRaRCs/7AHU7z?=
 =?iso-8859-1?Q?JuhEf8SmPjeCXRHBnbMhBFqNkA3dPBBtDTiAbiKyiAy7jNEAby+rlPNrvC?=
 =?iso-8859-1?Q?4QybdUS2X1owHtuD4oztOa2L5NaJe5KKqhexeZzHMS/FOHAH2adn1n7uEc?=
 =?iso-8859-1?Q?yNDfMNLBd0JYUHYjxjqyJwucVQWndhzUq2CQNxZiPQgwK9uRGFYBEHGnEV?=
 =?iso-8859-1?Q?0+n+T0X6gEc4X6wpgzZCT+KqQQPOCuMDIuigi5+olbq3hrwCTe3M1Q8BvE?=
 =?iso-8859-1?Q?2HS/bSeGMpArKbbThMOZtOsWfcaN+pWPbOEkrSCeY0mWxqxMH01gNDdxe0?=
 =?iso-8859-1?Q?K8YcqaHFd0/pFfUXEg9hhzRmebBf7vEDVRruR6WDlsPF6Qlw0kv9Q9G5my?=
 =?iso-8859-1?Q?LeuYVq1tDJrhcXbougbmGD/eDo9slLgDpDCOZulh//2IF9SJo8pGauX22I?=
 =?iso-8859-1?Q?a2kNq7Pvgk+rfVXXKKNExMbRNdRYYcPLt4pDJNJ8wCr7j1nIbyDE+uvign?=
 =?iso-8859-1?Q?Ge021Q7dHDzVVQK1oK/f7GgroX4719dZbkk0EFDIRjD/07Mw5nSRPprW1I?=
 =?iso-8859-1?Q?jmpbgCB9yTYajdE20iP5HjWsX8j2xyp9ZyevTN57wsYae8QccZzrvmUagg?=
 =?iso-8859-1?Q?XofjJcT0N5J1l5+HotsZQyALzT0MhAPlcHyoChF0fC2139lpYFKLjC45LU?=
 =?iso-8859-1?Q?xA9hpwIYhg6Todpn6ABCQAkt311lasasKxMKCKV90bHiaaYkJUztcRyLjD?=
 =?iso-8859-1?Q?x5WA2F7e36u5fGp+wKeYXVbaEwfHxFImGw/2IeXTZdGCQZnDht8nTFfz96?=
 =?iso-8859-1?Q?63+L90SqFeJkqFdRW0JnIsWhH7rsFW5v3rffHHCr9SsuAiwJ0GQ6nZhJ09?=
 =?iso-8859-1?Q?JA4exiS06gdUhtsiRP501tmEcFe0OnHZRGZxKpE3lF1nGA9ftk2bo1W10n?=
 =?iso-8859-1?Q?pXEQMdsNWBblG42CJyq0nJk/EOoQ70HLe1IN/DxYQPpGc6HnfpxMKHFJR8?=
 =?iso-8859-1?Q?jvreXZYv5d1wFk+ITkj0DRon74cr5hkSyMf+mNEplrsYK6JyfaSng4dVJm?=
 =?iso-8859-1?Q?BJuzxtr0kniWV5JM+AIvk6vAF26D66ew+sTKyWZ+GGPk+dw=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?Gfmuodgr/iyGSi3yk5GMDzulCyPlJI/ZZicY3crZ9w9emwZ2d7JZeEA7om?=
 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X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 09:51:46.0337
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 0ScIE/j1abGs+8qIcXgS7YYNTJTViROvlNvuhK7+5fN4obqkWWWIC9qiqsPFNUzWOQidrG8KdfnAJ3JtRvJqV1cLOWUSEmZHrvfsmMjPEnE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB6398
X-OriginatorOrg: intel.com

On 2024-06-26 at 09:46:01 -0700, Reinette Chatre wrote:
>Hi Maciej,
>
>On 6/26/24 12:09 AM, Maciej Wieczor-Retman wrote:
>> Hello!,
>> 
>> On 2024-06-25 at 09:28:55 -0700, Reinette Chatre wrote:
>> > Hi Maciej,
>> > 
>> > On 6/25/24 4:04 AM, Maciej Wieczor-Retman wrote:
>> > > Hello,
>> > > sorry it took me so long to get back to this. I prepared the next version with
>> > > your comments applied and Tony's replies taken into account.
>> > 
>> > Thank you very much for sticking with this.
>> > 
>> > > 
>> > > I wanted to briefly discuss this before posting:
>> > > 
>> > > On 2024-05-30 at 16:07:29 -0700, Reinette Chatre wrote:
>> > > > On 5/15/24 4:18 AM, Maciej Wieczor-Retman wrote:
>> > > > > +		return 1;
>> > > > > +	}
>> > > > > +
>> > > > > +	for (i = 1; i <= MAX_SNC ; i++) {
>> > > > > +		if (i * node_cpus >= cache_cpus)
>> > > > > +			return i;
>> > > > > +	}
>> > > > 
>> > > > This is not obvious to me. From the function comments this seems to address the
>> > > > scenarios when CPUs from other nodes are offline. It is not clear to me how
>> > > > this loop addresses this. For example, let's say there are four SNC nodes
>> > > > associated with a cache and only the node0 CPUs are online. The above would
>> > > > detect this as "1", not "4", if I read this right?
>> > > > 
>> > > > I wonder if it may not be easier to just follow what the kernel does
>> > > > (in the new version).
>> > > > User space can learn the number of online and present CPUs from
>> > > > /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>> > > > respectively. A simple string compare of the contents can be used to
>> > > > determine if they are identical and a warning can be printed if they are not.
>> > > > With a warning when accurate detection cannot be done the simple
>> > > > check will do.
>> > > > 
>> > > > Could you please add an informational message indicating how many SNC nodes
>> > > > were indeed detected?
>> > > 
>> > > Should the information "how many SNC nodes are detected?" get printed every time
>> > > (by which I mean at the end of CMT and MBM tests) or only when we get the error
>> > > "SNC enabled but kernel doesn't support it" happens? Of course in the first case
>> > > if there is only 1 node detected nothing would be printed to avoid noise.
>> > 
>> > I agree that it is not needed to print something about SNC if it is disabled.
>> > hmmm ... so SNC impacts every test but it is only detected by default during CAT
>> > and CMT test, with MBA and MBM "detection" only triggered if the test fails?
>> 
>> Yes, snc_ways() ran before starting CAT and CMT to adjust cache size variable.
>> And then after CAT,CMT,MBM and MBA if the return value indicated failure.
>> 
>> > 
>> > What if the "SNC detection" is moved to be within run_single_test() but instead of
>> > repeating the detection from scratch every time it rather works like get_vendor()
>> > where the full detection is only done on first attempt? run_single_test() can detect if
>> > SNC is enabled and (if number of SNC nodes > 1) print an informational message
>> > that is inherited by all tests.
>> > Any test that needs to know the number of SNC nodes can continue to use the
>> > same function used for detection (that only does actual detection once).
>> > 
>> > What do you think?
>> 
>> I think running the detection once at the start and then reusing the results is
>> a good idea. You're proposing adding a value (global or passed through all the
>> tests) that would get initialized on the first run_single_test()?
>
>I was thinking about a solution similar to get_vendor() that uses a static local
>variable. A global variable could work also.

Oh yes, static local is good too, I'll try that.

>
>> And then the SNC status (if enabled) + a warning if the detection could be wrong
>> (because of the online/present cpus ratio) would happen before the test runs?
>
>I do not think this was part of previous tests, but yes, this is a concern where
>a warning would be helpful.
>
>> On the warning placement I think it should be moved out of being printed only on
>> failure. I did some experiments using "chcpu" to enable/disable cores and then
>> run selftests. They didn't have any problems succeeding even though SNC
>> detection detected different mode every time (I added a printf() around the line
>
>I am not surprised here since there has not been much tuning of the CAT test.
>
>> that cache size is modified to show what SNC mode is detected). While I
>> understand these tests shouldn't fail since they just use a different portion of
>> the cache I think the user should be informed it's not really NUMA aware if the
>> detection was wrong:
>
>Seems like there are two warnings to consider:
>(a) SNC detection may be wrong.
>(b) If SNC is enabled and kernel does not support SNC then the tests may fail.
>
>For (a) I think that it is possible to know when SNC detection may be wrong. A test
>similar to the kernel test that compares the "online" and "present" CPUs [1] can
>be used. The /sys/devices/system/cpu/online and /sys/devices/system/cpu/present
>files are available for this. A simpler way may be to just print a warning if
>/sys/devices/system/cpu/offline is not empty and set the number of SNC nodes
>to 1. Instead, a new "snc_unreliable" global can be set that can be used
>to print additional information during test failure.

The empty offline file is a cool idea, less files to open :)

>
>I do think that it is fair to print all the SNC details during detection but
>I am concerned that those messages will be out of sight during test failures
>and I thus do think it is useful to have extra information during test
>failure.

Yeah, I've been thinking about what is the best way to display these for a
while. Maybe you're right that messages at the top will be lost. What about this
set of messages:

1. First run of run_single_test()
	1.1. For all tests:
		- detected snc mode (if > 1)
			- check if cpu/offline file is empty, set the global
			  variable and print a message saying snc mode might be
			  wrong

2. At the end of tests
	2.1. For CMT, CAT, MBM, MBA:
		- test failed
		- snc detection reports it's enabled
		- kernel version doesn't support snc

	2.2. Additional message for CMT, CAT (since the cache size is divided):
		- test failed or succeeded
		- snc detection reports the offline file is not empty
		- kernel version supports snc

The 1. message will be printed at the top since it's more informational (what is
the SNC mode?) and then 2. messages will deal with possible issues / failures
and will be nicely visible at the end. What do you think about this?

>
>Reinette
>
>[1] https://lore.kernel.org/lkml/20240621223859.43471-18-tony.luck@intel.com/

-- 
Kind regards
Maciej Wieczór-Retman

From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9])
	(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 9ABAA19A2AC;
	Thu, 27 Jun 2024 16:30:36 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=198.175.65.9
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719505838; cv=fail; b=n3lrk6mZbqBNZzZE0jPWr5Xbi+l61I7DEZyQivcwjV+3vus0xo9fHPpIIVxYs9bKZqXc6vwIS8qBw7YM1bK/2jqOoUZsnb/97462sJvS8mjTlkITxo44MzXbLihMWvLptPLvS2gLTkFazhdD5GhmrDRyhnkfW3qoSOKdwxRhcPY=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719505838; c=relaxed/simple;
	bh=AWdiiJH/tNI4aPJyk7W3yFPAh5UtLV6YedFcMZQNIZA=;
	h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To:
	 Content-Type:MIME-Version; b=IqxuBEmQOw9VT6/aZP4vrYFYtYkL96dQACXTvzk89rhp04zjbJq+DWk0W2GD1H/89lJmywW2HflZRYzsvcyL+owV4Li7bvOZbimjs831oJDXeRXnVFPpGbLLWL8pbanXfvXWMWTww8oR0UiyOS5VnkxBgIeS+kBgQdZGSOJdxGA=
ARC-Authentication-Results:i=2; 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=el4hKOkG; arc=fail smtp.client-ip=198.175.65.9
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="el4hKOkG"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719505837; x=1751041837;
  h=message-id:date:subject:to:cc:references:from:
   in-reply-to:content-transfer-encoding:mime-version;
  bh=AWdiiJH/tNI4aPJyk7W3yFPAh5UtLV6YedFcMZQNIZA=;
  b=el4hKOkGStwgFGVz9cNf9m2973FFd+HpeeOvG1ryOZze2Epr6zLkG6kY
   wcKi7Gs5bRTjgzJ7bleIWRoaj+gfXX5bxfj0mp0YQvGkD78LbAi9ETg5G
   3T0YlxRoIgL1GGoPo3pWwP04ChYML7sdBhLkY7uBHNqO6SJYuqP/bgi9h
   qOoATP4VGwWMj76/T83W9jogjKId6UXK1nutBeYRQkkAZrauqyUVrHT1j
   oTGmgHoBJ1/h2hzGHL7tl052yOgwLvxd0+yD25NDkkkUa2bcgcyCU8tDZ
   L/L+Pu+W15XLfpI8FqLNmrSv+HTMSlu0oLJwrLZfRzOMtmu6KTSZqZZVJ
   Q==;
X-CSE-ConnectionGUID: 8wUKF2mmR5yFAz7Nfkr8TA==
X-CSE-MsgGUID: 3aw5w0kBTn6YBZ5ba9RxvA==
X-IronPort-AV: E=McAfee;i="6700,10204,11116"; a="39168160"
X-IronPort-AV: E=Sophos;i="6.09,166,1716274800"; 
   d="scan'208";a="39168160"
Received: from orviesa006.jf.intel.com ([10.64.159.146])
  by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 09:30:30 -0700
X-CSE-ConnectionGUID: L8EqTZKFTviXn+owzKf6DA==
X-CSE-MsgGUID: aOjM5zqJRSK2pHj3L6QfuQ==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.09,166,1716274800"; 
   d="scan'208";a="44839577"
Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16])
  by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Jun 2024 09:30:30 -0700
Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by
 ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 27 Jun 2024 09:30:29 -0700
Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by
 ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Thu, 27 Jun 2024 09:30:29 -0700
Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by
 orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Thu, 27 Jun 2024 09:30:29 -0700
Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.49) by
 edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Thu, 27 Jun 2024 09:30:29 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=ih6J/jN0fY1wCG0fKcU0Rm2hOri9UcyHXpA8LR8Vo00SRvmncBJU/Wyb1cQR5yV83JA2Cw4pC6S+Drbo7SMDqykVDn1KetdIFySYSYAZMJqqPr/nL334vPfDgZtTzroyVLPeRCALMbM7dU7r1e8LGs26GAgFrK0qvwuw1DWOuMVLZgqJxiLewbVA93EH051eMqPSXLsXK/uOzmz4XzySfdt5moCxPclLv9UkzIxBkpJWMg62M/+b+ilPKE37N/jXt70blT4pyiXHB4bTIaiQc4ccXkBDvbbfmdYBzGWFekwDb5srInUv/aoCE9/GlbScB1/PIY2fIvVVPkblKeDYyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4XlnUpyAlDqAUz8NrJtuUp7DQe4fxk0tcVpvP5LOjto=;
 b=W7UBQi2jBa21sMGoy1EIwfe0hV9s0kq+BhzYvG5tmczi5vzMU4ICLJydLXB+SXAslK3D6I0LfQfcawXt9ijU8ljc3+aOtIzMWaJn4WSgfR77tK2nROvqUuig117BGkXxHZYx67d55cYJFaV6qE+PF6aOyZc4Ij0cduz1+3SNHKmUExj+3Uh7mBIaPcvVjGhxDPWMu0T5r6WpMOIiwoboMZze9t2lDMd8k1p5Ksm2JkZh7nGCmYIBYLN1a9h7HhyP6szUfE/yRkkcUshJIXjpxpAx9HqoHs/8BKDPiWGkTeTT3dzpF2/55p6LGjFt4hQje8opBEgcxFFSFkLJirRlNQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com (2603:10b6:a03:4d2::10)
 by DS0PR11MB8081.namprd11.prod.outlook.com (2603:10b6:8:15c::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun
 2024 16:30:27 +0000
Received: from SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf]) by SJ2PR11MB7573.namprd11.prod.outlook.com
 ([fe80::61a:aa57:1d81:a9cf%3]) with mapi id 15.20.7698.033; Thu, 27 Jun 2024
 16:30:26 +0000
Message-ID: <ded7afa5-7197-48e1-98bb-066b9df285fd@intel.com>
Date: Thu, 27 Jun 2024 09:30:24 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
To: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
 <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
 <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
 <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com>
 <ewkiaarsl4s4aofw2uykhup3eyutnzitlow3muzbaqqf4xp53g@6lgc5o2dkmor>
From: Reinette Chatre <reinette.chatre@intel.com>
Content-Language: en-US
In-Reply-To: <ewkiaarsl4s4aofw2uykhup3eyutnzitlow3muzbaqqf4xp53g@6lgc5o2dkmor>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: MW4PR04CA0124.namprd04.prod.outlook.com
 (2603:10b6:303:84::9) To SJ2PR11MB7573.namprd11.prod.outlook.com
 (2603:10b6:a03:4d2::10)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR11MB7573:EE_|DS0PR11MB8081:EE_
X-MS-Office365-Filtering-Correlation-Id: 902517b4-2cca-4120-c89c-08dc96c67377
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info: =?utf-8?B?UmtON0RyOHZnOFNRRE1NYnQ0eWxqYXVNajBrSXkySkN2UTRHdzRzc0JqYkhP?=
 =?utf-8?B?TWRmR0JJK3JuM2tuS3NhSWZrK3NPNXNlU3JoL3RpaFZSZ3JvclFxODJGSzcv?=
 =?utf-8?B?VjBLV2Vkb29OQlhGMC96U0FOWkhrNW5WOUFzRVBQc2JlOUlSdllBQXNBZWVW?=
 =?utf-8?B?bHJIMmRJV3MrU3o2VU1mcThSbE1yS0sxb2krTkhxbXBDS0RST1NOeFJHL2VS?=
 =?utf-8?B?Sm1Oa1hJOGZUbGc0VWkvU3IrU3VYd2dQbnFCbUJDUnM2bmtqa2laVkNtN1lj?=
 =?utf-8?B?QUNBTktaNzI2MFlTNXVSYnVZWWVqN09vV29Ici9PRy96ZGRSVTdBRWJGNVl3?=
 =?utf-8?B?Uml1V1c5OFZBNDc4MFl2QlVEaWtmdUJaRWR6VDIrTXhzOW5oUXRGMzJPS1U1?=
 =?utf-8?B?a1R1NGVnNDEwMjAyMXFQVzNKZGx2QmNBaXRxT3M0MlpQWDRYbVZ6SGZ1YlJq?=
 =?utf-8?B?Vm9HeGdaMDNLVFgzU216TW9MVjNGaDRkdktQODVQRk5zUXhtNHdjdk44VmhZ?=
 =?utf-8?B?TFhvczNwM3ZUUjYvajJOUGxMNTNBTGlDcXNVRHpZSVIxMGprQUtmR0hGS0RD?=
 =?utf-8?B?OUFEU3kvWHkvUWlpSlRSR2RndnNzOXBqZFF0TFNmYncwc3ZLNnIwdnQyZlNZ?=
 =?utf-8?B?c0dGNzN4UWVMckNueU9YZkhMRStyYWVKbzBVRGVaQ3hXSzVRejVoOGQxNVJs?=
 =?utf-8?B?M053cHN6bFkwckt6cHBoR3dXWXI2ZG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?=
 =?utf-8?B?bUZVRVZPNHU3bFBqejNVV1RXdlNiRVVYMDVwbko3WFcrVzhRUTVSQ2hyZ1Bl?=
 =?utf-8?B?MWVGS0FCRnNTUjdPai9DdWZQNmtIQXE0bWdaTnQydk93eUo4OWRWU09XRlk5?=
 =?utf-8?B?bmJQcDJKaEQ3ZjJYOVcxQ1FPaDFObzhvMWlWMGxqc0Rvem41UlR4bzNFSG9Q?=
 =?utf-8?B?dXNmOGt3MHp1b1RaQVZMUT09?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR11MB7573.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WlRidUxBOFp1cXZ4bEhCUFhEN3Yrb2laOVdDLytkRU5XbWY1Y1l2Mk41bkt3?=
 =?utf-8?B?Ulg4TUVJUmNLYi9iMmo3T0FaYlptaXUzWkdCTm5UaENXTXB3dkx5NjRyMldN?=
 =?utf-8?B?YmZpclFJa2FCeXYyb2lGUHV4NXYrTkRlM1laMnN0L01SVzJzdXlxQnIwdnp3?=
 =?utf-8?B?WUV6dDBvNTJCU3hUUUt2K3B3RnZpTFBLaDk5VktLdTE1TDBLQWVSY2Y1RlMy?=
 =?utf-8?B?NytsYlQ3ZytoQWdSQ2RZY0lJSWQyeU1ZdW9wVTFkOTAxTDUxVm9VdDQzMkh6?=
 =?utf-8?B?NEdtM1BwQ3YvNzd1d3hwYWxHNnU3b2NqMnJXUnFpKytCQ2tpR3hBczh6a01l?=
 =?utf-8?B?NEZhb2YyRnN2WlkrRmh5U0hkTVAzdjN0TzJ4WG5EOXRQZjB1d2ZsZ05IdVRU?=
 =?utf-8?B?dkltSldZb3ZLNFpOK01YQ0RVOHJmbFR0RmpVNzNvR1ErMVd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Q==?=
X-MS-Exchange-CrossTenant-Network-Message-Id: 902517b4-2cca-4120-c89c-08dc96c67377
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR11MB7573.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 16:30:26.6451
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 8doduaWFDEinFCdw+xRGi1mJ2Z84Hgd4nOmxci9Be5b0Azf9M5Zs22m3iikyCFcl/1J34kTGhhFS4IhBiE3cf7d0M+bGVFAd7OIf1b2w8SE=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8081
X-OriginatorOrg: intel.com

Hi Maciej

On 6/27/24 2:50 AM, Maciej Wieczor-Retman wrote:
> 
> Yeah, I've been thinking about what is the best way to display these for a
> while. Maybe you're right that messages at the top will be lost. What about this
> set of messages:
> 
> 1. First run of run_single_test()
> 	1.1. For all tests:
> 		- detected snc mode (if > 1)
> 			- check if cpu/offline file is empty, set the global
> 			  variable and print a message saying snc mode might be
> 			  wrong

When SNC detection is considered unreliable, everything else becomes unreliable also
since kernel support for SNC is only visible (in future kernels) when SNC is enabled.
I thus think that if it is found that SNC detection may be unreliable then the number
of SNC nodes should be hardcoded to 1 and a default message about possible interference
by SNC should be printed at all test failures.

> 2. At the end of tests
> 	2.1. For CMT, CAT, MBM, MBA:
> 		- test failed
> 		- snc detection reports it's enabled
> 		- kernel version doesn't support snc

Sounds like the "all goes well" scenario when SNC support is reliably detected.

> 
> 	2.2. Additional message for CMT, CAT (since the cache size is divided):
> 		- test failed or succeeded
> 		- snc detection reports the offline file is not empty
> 		- kernel version supports snc

I am not able to follow what happens in these scenarios.

> 
> The 1. message will be printed at the top since it's more informational (what is
> the SNC mode?) and then 2. messages will deal with possible issues / failures
> and will be nicely visible at the end. What do you think about this?

It is not obvious to me what the messages may be but the times/locations when
messages are printed sounds good to me.

Thank you

Reinette



From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18])
	(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 40602558B9;
	Fri, 28 Jun 2024 07:52:37 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.18
ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1719561159; cv=fail; b=tpvsSz1ojEyKbrXgXyZ7tKp9RqGUQXKj2/RYE/Ptd1fMgiVGP2gh5h3z49g/H1O1pvfRcTSwFZ6JmIGSYpGKvfYdVN2kFw8IHgajUEqDRaCzBK75DP5LKdQZX7CSxtr1KgZY/TEkT+eZPVB5QZ0hk41npMlGFvWaImfjruyV39E=
ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1719561159; c=relaxed/simple;
	bh=dF0ZgMHVwPSI/V2/Azak6+JYIu5KWq4Uq/ARSy9lvaA=;
	h=Date:From:To:CC:Subject:Message-ID:References:Content-Type:
	 Content-Disposition:In-Reply-To:MIME-Version; b=JODMwyIOzm+b8H7VSnEmuISCqwZYYqSQhzOO0QSBoOwVULGERo5sc2jb7jTFV0cW4RCfDs9R+fGPXMg1d5F9BVD/VdSS5tE6/PAJ2+YgbJRd6rbVpyZGESwNheEU1FLR5ONY4mEMrtjss2PxlegKfuBLnqfQF3vWtFFpoVk6W6A=
ARC-Authentication-Results:i=2; 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=GfDmae4Z; arc=fail smtp.client-ip=192.198.163.18
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
Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GfDmae4Z"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1719561158; x=1751097158;
  h=date:from:to:cc:subject:message-id:references:
   content-transfer-encoding:in-reply-to:mime-version;
  bh=dF0ZgMHVwPSI/V2/Azak6+JYIu5KWq4Uq/ARSy9lvaA=;
  b=GfDmae4ZGRdg6hI/yUQWTl5lWvAGE4nbjmJCcTE91J2sCwNMTnPdHW99
   XTg4TrZxvHJkV9nzmkg2gFB9AijzUX2Nd1BrhEaiqkseWqskfpWR601CK
   pczeIcoY+CC8G71gsCCeU/xTy8eHaC1F+FBR04s8R7qLIHLVEezIqiqul
   bqSz3h7n7TvtZA3nlA003vLGSDuZbpbKMYxuFKc3cQM5bJsF5CA9CzUl6
   agh+wvyTiGhmpIu8CzyeTsjO+J9RfLyaIo5ANYQH1vsE9KGb8R86ln3e+
   24SR0rgKKHt/PcnKDzun6dzindrFsJ3L5Qp4shs9nDRLcLAsACazNJsQv
   A==;
X-CSE-ConnectionGUID: rXOrqPpATGqw4FocI/L53g==
X-CSE-MsgGUID: UGz5fsemQb6Ub9wIBmBIOw==
X-IronPort-AV: E=McAfee;i="6700,10204,11116"; a="16410859"
X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; 
   d="scan'208";a="16410859"
Received: from orviesa005.jf.intel.com ([10.64.159.145])
  by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2024 00:52:37 -0700
X-CSE-ConnectionGUID: J2NMFl7bRnGKzjhj2WBXcA==
X-CSE-MsgGUID: GOVaVvMARfqFwDqEwi4cmg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; 
   d="scan'208";a="49615224"
Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15])
  by orviesa005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 28 Jun 2024 00:52:37 -0700
Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by
 ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39; Fri, 28 Jun 2024 00:52:36 -0700
Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by
 orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Fri, 28 Jun 2024 00:52:36 -0700
Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101)
 by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.1.2507.39; Fri, 28 Jun 2024 00:52:36 -0700
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=jeN5CijNYAypl6vmGEx6e/n7o0xIGizEgOL/MNY/C5dc4H0rMAmU7cAU1D+e8DfzPglMR+QiG2Vn/IvpMhDsBMtGtkqdCc+g0hSAqxDHYBRofGZnB2qeEKlvDRcNxzcQHr5sem2Eek1G8EMSsJl7RYRmyWmC9IAwtZhHWwB3dgjslWhJH0RvwUtKsm8agze7cawJ5AA2F/WWuEVTsJ2X+kH6bTqb3iswklQ3N8W0LCW6oUXcMadO7jOWEpBWmADxVlP44iQa4QD+zXsRLGOhwOnbFVUEli7Gm3rM4yO6mSHM3hITPhozGcZi5dFwsf0YykhKnenQf2Sj9M7EvxFfWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pbWgJ6Yyk8Ty6BWrygcEU/QaQv59tfln8Pupllr0lKs=;
 b=Jj6yCSeUwKqgkh0c216EbHPNw9Z6EPUus4xWqoDlzkOOxk+geFTVXhRHIV57VTU8ppaEYk3yNbmhLghgAY6R8r1wKMeV6Gd4kzQJ6jZzrn3S/w8k6sOY24QHjlekCW4rr99IXQojxyAVZLzn8pQzmD49Nh7wzZc7IGxhZFZoUggUJQhxo97+Dmotpb/3cAn8FbcSkydGyxz4Lh9+hIYb8NCdXykBVZM0VAiN6dGvPZWIl0A9vRmEs3dppuZq2vJplvAVReI6xGpJWAXWbx9l5UyR4KIQlt3cYbJEmEHnR/HEcY6E0ad5pfDBVJOTp7f3MeT++6QT4aw2DlXw7EMLBg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;
 dkim=pass header.d=intel.com; arc=none
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=intel.com;
Received: from MN0PR11MB6231.namprd11.prod.outlook.com (2603:10b6:208:3c4::15)
 by SA1PR11MB6965.namprd11.prod.outlook.com (2603:10b6:806:2bf::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.35; Fri, 28 Jun
 2024 07:52:34 +0000
Received: from MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4]) by MN0PR11MB6231.namprd11.prod.outlook.com
 ([fe80::a137:ffd0:97a3:1db4%3]) with mapi id 15.20.7719.022; Fri, 28 Jun 2024
 07:52:34 +0000
Date: Fri, 28 Jun 2024 09:52:18 +0200
From: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
To: Reinette Chatre <reinette.chatre@intel.com>
CC: <fenghua.yu@intel.com>, <shuah@kernel.org>,
	<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ilpo.jarvinen@linux.intel.com>, <tony.luck@intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Adjust effective L3 cache size
 with SNC enabled
Message-ID: <6t37aaepgw3r4db4t5usfc2zz3mv3ugzcreleig5md7wlyjnzc@5eie6g7m3hhi>
References: <cover.1715769576.git.maciej.wieczor-retman@intel.com>
 <fe9295c6be677d187b1607185e23993dbfe74761.1715769576.git.maciej.wieczor-retman@intel.com>
 <9fa47acf-86b1-4602-8790-39ed80fd775a@intel.com>
 <n2el3evhluilmjhrwgpkkb7ld2g26zhmctxvm77b3ome6u6egf@hym7rnr3h2o7>
 <9b976e89-0320-430f-9f0f-48e25612ec98@intel.com>
 <b5xggwzdvavhqmxpaeisovp3e2xzjjhvkoqcbt6hg3sv3wzh3i@a7qaatwfpbf6>
 <5bd8e17a-5810-49a2-a07b-88c05ca21af7@intel.com>
 <ewkiaarsl4s4aofw2uykhup3eyutnzitlow3muzbaqqf4xp53g@6lgc5o2dkmor>
 <ded7afa5-7197-48e1-98bb-066b9df285fd@intel.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ded7afa5-7197-48e1-98bb-066b9df285fd@intel.com>
X-ClientProxiedBy: DUZPR01CA0321.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4ba::15) To MN0PR11MB6231.namprd11.prod.outlook.com
 (2603:10b6:208:3c4::15)
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
List-Id: <linux-kernel.vger.kernel.org>
List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN0PR11MB6231:EE_|SA1PR11MB6965:EE_
X-MS-Office365-Filtering-Correlation-Id: d5d2685f-9850-4f56-af8f-08dc9747453a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info: =?iso-8859-1?Q?MEFBfj9B3r+EaRhBOrWtOH0j5WHY6AVLqzlEzeT3xdj+0PKE6YDPJCUcPC?=
 =?iso-8859-1?Q?SJTF3ygQaTviT/VaWdt5pwsud6jvohMYXMq7eW+X/HTBOcb4fow/HFEd/4?=
 =?iso-8859-1?Q?tUb3+jaPTaWtUWFMX2TJaycuQ7eDIG46qd2/++cANU8j69EEabWOiIK7kn?=
 =?iso-8859-1?Q?Y+NCz4Y8KUQOeb/lYN60PRsng9jPEWo+qxQWtBEtR5aV0IPf92WtvJ3WFz?=
 =?iso-8859-1?Q?hZE+BwGsp9HCAfdzG3QIERmW5JuZzAsNB+QiSRdVBS8lMMn3jnSUJsr/mO?=
 =?iso-8859-1?Q?5C8uYDLEjWEqsXlqcqiXLH0TRSYdNHF9T8HhNkV8P+j7qz+cK5uTPaG3/b?=
 =?iso-8859-1?Q?aS4q8EcZxdcq9jTTvgd7qZO56HNOIt2RMCj53YAwasndizHrddTf18OV81?=
 =?iso-8859-1?Q?nhxvVirFp0rNhSL7V5eyvWPCxwim7LeOOMhpz1vziYIBqI+WWffTnwagHO?=
 =?iso-8859-1?Q?HjXALsSiMXrJgjN0ZzXWkkU7je+arRji2AfYAbIyoX3MzDot/Xfoch1Vsc?=
 =?iso-8859-1?Q?6TbCRqIohpGmqnOP3KSmI73tky84oFCqyW7CSG4BA0ehVoi7IBCYggOKf9?=
 =?iso-8859-1?Q?5TWk6FBtMT3cTPAU9lRDsLASZ0x0JFif5UzjkjMBpRG/RwsQdvvAwDb/XQ?=
 =?iso-8859-1?Q?nL79O16ns8WvLavcmhwYuULVbQawrP5ZqBjJ8By/W91ohTmi39cYBQH+PZ?=
 =?iso-8859-1?Q?MTZ5YGOffX9L+WS4r4UkEQmbbQlerOp7anVkY7uozpOg6t/PF0ZWOOFqD0?=
 =?iso-8859-1?Q?euri98cehfJXErSq6k7GrT1KxTDvKqtVKk5cyRdI3KT/Jl662m6GkBPpnp?=
 =?iso-8859-1?Q?8dEFMV8ycNozHbpqi3NuW51n2zWcQgSNYh8YSOUDQOYxdiuX1Spa/wfYk+?=
 =?iso-8859-1?Q?Z9i3bQTGNh7reQuVPXSAjsZvFtOptS+BtLAkNM8b4nfeTMymFmlkUEGOf2?=
 =?iso-8859-1?Q?xq5kzKRhJM+tCya8D5ZHpzn6I+OaTRRZLBYPNwm3W+3XB3uDC8qN5MNweS?=
 =?iso-8859-1?Q?yU1yY3kScSjhvGeA8zcrOQSN8VG3QeJeQuwJRSQUC7fieovnFkEt7VByHx?=
 =?iso-8859-1?Q?82tUeF7jbjuUNVxGGWZBxFfi7ofZ80k7L2U6kFnf3Lk1O0VBwLHP9fE8qS?=
 =?iso-8859-1?Q?X1GmXW0CJFc+3zRqAgRgsOCNBdN4BUbQ0xsok7r2Co5+DNOc/OyIfM57LR?=
 =?iso-8859-1?Q?FM7LkNwoPtzqGRn06dUHf2VFvzrj3xW4HGqUPxtOVfQVgFI0cDq46Y34mT?=
 =?iso-8859-1?Q?+PFWYW9FnH1LJ7She7MNScuPSFP0inBVNsfGNYljmilmkasMGyYdHrXPYV?=
 =?iso-8859-1?Q?BoOOPUyZC5Hcn1tBToUMwJCelYbB1qL4XF09kq0VGmijHRMPoClF1RFMbL?=
 =?iso-8859-1?Q?jNh/G+sTzuPUUvmdhErsjdnXcODUAGUA=3D=3D?=
X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR11MB6231.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?0CLabb8vGycDx3XQdgiXi6S2BF7RXJn/Hp2OT6Zt0DbP8HHPdnTkARups3?=
 =?iso-8859-1?Q?mUyoV3nkYQl7bUTv7K632ThszzstysMYDCwWt0kuvYlMBbMiBxgxvfhn/c?=
 =?iso-8859-1?Q?swzQoQEAClT/Z4YCrXUxbh7SiplpoBVfKI8uYC4aGawsRgl5D/sPVqPX/u?=
 =?iso-8859-1?Q?lJBfFRODqA4+8UUJnOMflKbcUhe4S4RAratydJw6hTUGhT5VoeUO6aeNni?=
 =?iso-8859-1?Q?NFK5QsVLfA5w4gFyNOzXsg/DkuI8M6f7046v+cfR1NIANZVgS5YYFtdSji?=
 =?iso-8859-1?Q?jGtq7YucPmP/H/5ZNm1fS7t9BLhif56LTZ1zDjuj1Xwt5Cb49t3qqSMODZ?=
 =?iso-8859-1?Q?eZ8oUBUmRp+XnXtPmI+hBKh/DgvpIfHunD5zxZdef2T/AVkNsq9zt9Pyov?=
 =?iso-8859-1?Q?ETqezzwBUCjmaU79t7gZnZYruZBIhrILlg3jgFpciUZ8ByUrOvw1e/c8Bu?=
 =?iso-8859-1?Q?WK7IgZzrMKE1IWsOrxlIBuyI9JwQlUiCzxnirsDeUmQUPv2LhabhpR6uZt?=
 =?iso-8859-1?Q?DGPjfmRTDL3S/bID51/o9clV2TSnYamp3XloFdzSp6EbW68ERNMhASog7h?=
 =?iso-8859-1?Q?sd3GnpejOlg0d1wLVQYx4x3hdBGGnqRA5UsimtbGqjoPg+PtRQqvO2T+Vb?=
 =?iso-8859-1?Q?nIyhGR/cZ5JVOIMTSyJMbiHA+lD9juPOkYH7WTxCqCnako4nRjDODHpX7i?=
 =?iso-8859-1?Q?pB1OTyqU86CnUvR07ItG1uQC7yyQMFixbBPL0MeOQGfIc57CF2UsmubuJA?=
 =?iso-8859-1?Q?lJwe+DqPNlTG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NUuh2AT+Xj0LfOjm9dQUPr2pT3h3bwl6v/0SHigXcYY2eM?=
 =?iso-8859-1?Q?rOFiECa8mscAM0swT0U=3D?=
X-MS-Exchange-CrossTenant-Network-Message-Id: d5d2685f-9850-4f56-af8f-08dc9747453a
X-MS-Exchange-CrossTenant-AuthSource: MN0PR11MB6231.namprd11.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2024 07:52:34.2170
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ptsxud9teRIjleqtiIFPx7P8+KN0MXfi891a/GWy+3hwC270+DLy+lPTyRluQOGQU8v+l7TQr9P78AMr9ex61jsQtuisBFEvNDR3W5mwcaY=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6965
X-OriginatorOrg: intel.com

On 2024-06-27 at 09:30:24 -0700, Reinette Chatre wrote:
>Hi Maciej
>
>On 6/27/24 2:50 AM, Maciej Wieczor-Retman wrote:
>> 
>> Yeah, I've been thinking about what is the best way to display these for a
>> while. Maybe you're right that messages at the top will be lost. What about this
>> set of messages:
>> 
>> 1. First run of run_single_test()
>> 	1.1. For all tests:
>> 		- detected snc mode (if > 1)
>> 			- check if cpu/offline file is empty, set the global
>> 			  variable and print a message saying snc mode might be
>> 			  wrong
>
>When SNC detection is considered unreliable, everything else becomes unreliable also
>since kernel support for SNC is only visible (in future kernels) when SNC is enabled.
>I thus think that if it is found that SNC detection may be unreliable then the number
>of SNC nodes should be hardcoded to 1 and a default message about possible interference
>by SNC should be printed at all test failures.

Okay, that sounds good.

>
>> 2. At the end of tests
>> 	2.1. For CMT, CAT, MBM, MBA:
>> 		- test failed
>> 		- snc detection reports it's enabled
>> 		- kernel version doesn't support snc
>
>Sounds like the "all goes well" scenario when SNC support is reliably detected.

This was supposed to be the error message that was already there before - now
I'd just add the information about whether SNC was actually enabled.

>
>> 
>> 	2.2. Additional message for CMT, CAT (since the cache size is divided):
>> 		- test failed or succeeded
>> 		- snc detection reports the offline file is not empty
>> 		- kernel version supports snc
>
>I am not able to follow what happens in these scenarios.

And this I intended as an explanation to the example I mentioned earlier - the
test succeeds but the cache size was miscalculated due to offline cpus. But
after applying your suggestion above to just set the snc mode to 1 when SNC
detection is unreliable I guess this doesn't matter anymore.

>
>> 
>> The 1. message will be printed at the top since it's more informational (what is
>> the SNC mode?) and then 2. messages will deal with possible issues / failures
>> and will be nicely visible at the end. What do you think about this?
>
>It is not obvious to me what the messages may be but the times/locations when
>messages are printed sounds good to me.
>
>Thank you

Thanks for all the tips and great ideas, I hope to send the next version between
monday and wednesday after trying to trigger all possible corner cases.

>
>Reinette
>
>

-- 
Kind regards
Maciej Wieczór-Retman

