From nobody Mon Dec 15 22:06:10 2025 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 9C733307486 for ; Wed, 10 Dec 2025 23:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765408498; cv=none; b=CH+XPt9ErtNE2myl4kfm1AsE7rNTbchklYaJTKfMax6YHeLZ2bsgk/5AYKpLErhUbsBdf5Fq95lqPqxk0CpJXRK+DmzoASwZGLXrRe6EuoC9CEltRAh5N6OGySlI5xXmvSXLjOFjeprBvK4wiuHNW00CQAY1gTDN6LtjxtroMxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765408498; c=relaxed/simple; bh=9KtQhAEuNacTIhDtiaux0qfjZKcSMZhDOZ14EYOTjwQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=agNwpC4e4aqj/5efwY9MsHw27NyXWUIEDdhqyhVi0bvKbNwu56eu64xC7TQK/+TQiLqD+OylbPTrg1vcwuZztnACw6OPgi4vcldD83uIebv96n75qekxFuB8+VSkafaooQZ2ALrmQVA6yUokCXZEWy3wlpsYQraMkiEL5rl0j5U= 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=a/oQHNRb; arc=none 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="a/oQHNRb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1765408493; x=1796944493; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9KtQhAEuNacTIhDtiaux0qfjZKcSMZhDOZ14EYOTjwQ=; b=a/oQHNRbABDxClTRh8rBxbjsk4oIhjRzTCuHfFfVW/S5SkJG9oYugJsO ooYE/+BrFHDwueWVd2Xwif6xxXbe3amogUQMwsjbf7ZB6lrhz7kGfK8p7 eHplVQKVE9VV700GHE0+glsIHA3PZGfz+HSavKokFTia2nfKduTIvZDGn ul5Fa7vNauV5vgArFC0ghgTd0Emdb4cLA/t7n6v3xKn87X3qt0ie7PNlv jmyTUDDEwoJISWr8vqfGSlA81eRKlVenOFD9NzU8jjmKBcWpa7sIvtmN4 HKiUMrItumc9IKTSIHFmwSuKkLdHkB1v2hJszzBqAyoaDsVFcNYvXnBZs g==; X-CSE-ConnectionGUID: z7DDBFewTvyCJhXGaKBUuQ== X-CSE-MsgGUID: 10qH7a8SSnukqNYLcOpzBg== X-IronPort-AV: E=McAfee;i="6800,10657,11638"; a="69973595" X-IronPort-AV: E=Sophos;i="6.20,265,1758610800"; d="scan'208";a="69973595" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2025 15:14:34 -0800 X-CSE-ConnectionGUID: 9H1zVkj4TtargcZiv9i/8A== X-CSE-MsgGUID: aIiSpyglT0WkhdBellUIFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,265,1758610800"; d="scan'208";a="227297083" Received: from daliomra-mobl3.amr.corp.intel.com (HELO agluck-desk3.intel.com) ([10.124.221.254]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2025 15:14:33 -0800 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v16 15/32] fs/resctrl: Emphasize that L3 monitoring resource is required for summing domains Date: Wed, 10 Dec 2025 15:13:54 -0800 Message-ID: <20251210231413.59102-16-tony.luck@intel.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251210231413.59102-1-tony.luck@intel.com> References: <20251210231413.59102-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The feature to sum event data across multiple domains supports systems with Sub-NUMA Cluster (SNC) mode enabled. The top-level monitoring files in each "mon_L3_XX" directory provide the sum of data across all SNC nodes sharing an L3 cache instance while the "mon_sub_L3_YY" sub-directories provide the event data of the individual nodes. SNC is only associated with the L3 resource and domains and as a result the flow handling the sum of event data implicitly assumes it is working with the L3 resource and domains. Reading of telemetry events do not require to sum event data so this feature can remain dedicated to SNC and keep the implicit assumption of working with the L3 resource and domains. Add a WARN to where the implicit assumption of working with the L3 resource is made and add comments on how the structure controlling the event sum feature is used. Suggested-by: Reinette Chatre Signed-off-by: Tony Luck Reviewed-by: Reinette Chatre --- fs/resctrl/internal.h | 4 ++-- fs/resctrl/ctrlmondata.c | 8 +++++++- fs/resctrl/rdtgroup.c | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h index 0110d1175398..50d88e91e0da 100644 --- a/fs/resctrl/internal.h +++ b/fs/resctrl/internal.h @@ -92,8 +92,8 @@ extern struct mon_evt mon_event_all[QOS_NUM_EVENTS]; * @list: Member of the global @mon_data_kn_priv_list list. * @rid: Resource id associated with the event file. * @evt: Event structure associated with the event file. - * @sum: Set when event must be summed across multiple - * domains. + * @sum: Set for RDT_RESOURCE_L3 when event must be summed + * across multiple domains. * @domid: When @sum is zero this is the domain to which * the event file belongs. When @sum is one this * is the id of the L3 cache that all domains to be diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c index f319fd1a6de3..cc4237c57cbe 100644 --- a/fs/resctrl/ctrlmondata.c +++ b/fs/resctrl/ctrlmondata.c @@ -677,7 +677,6 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg) { struct kernfs_open_file *of =3D m->private; enum resctrl_res_level resid; - struct rdt_l3_mon_domain *d; struct rdt_domain_hdr *hdr; struct rmid_read rr =3D {0}; struct rdtgroup *rdtgrp; @@ -705,6 +704,13 @@ int rdtgroup_mondata_show(struct seq_file *m, void *ar= g) r =3D resctrl_arch_get_resource(resid); =20 if (md->sum) { + struct rdt_l3_mon_domain *d; + + if (WARN_ON_ONCE(resid !=3D RDT_RESOURCE_L3)) { + ret =3D -EINVAL; + goto out; + } + /* * This file requires summing across all domains that share * the L3 cache id that was provided in the "domid" field of the diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 4952ba6b8609..dce1f0a6d40b 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3095,7 +3095,8 @@ static void rmdir_all_sub(void) * @rid: The resource id for the event file being created. * @domid: The domain id for the event file being created. * @mevt: The type of event file being created. - * @do_sum: Whether SNC summing monitors are being created. + * @do_sum: Whether SNC summing monitors are being created. Only set + * when @rid =3D=3D RDT_RESOURCE_L3. */ static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int do= mid, struct mon_evt *mevt, --=20 2.51.1