Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp830016rba; Wed, 27 Mar 2024 13:06:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVg81pbdnKo/BCFYJgM/Qqc1Ze+ioHxQaqH9foJqjGacHBfrxAo2it5nlbzHYHuS/ILdbpdt8oEjN+cgEvT/oCuGi40g8nm6Cm1maY0Qg== X-Google-Smtp-Source: AGHT+IHGP30jkSP13xv9Q2G9+QPzSAP6s+4rZoX9rYqnmD3AR+EfXKmL3KvXvLFAKvx7y2SnmlBr X-Received: by 2002:a05:620a:ccf:b0:78a:64b4:95ee with SMTP id b15-20020a05620a0ccf00b0078a64b495eemr507310qkj.37.1711570014374; Wed, 27 Mar 2024 13:06:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711570014; cv=pass; d=google.com; s=arc-20160816; b=LLhqWSEHlBzJz4ujhgX3ViguPYm9JaGnTBvvHrCXrK719wEhncnGtTe/1+5BE4z36j T5SFLXU1QZDosHiV0z3FHWnvaXTyFu10oaPC6z+j+al4I7cadIWcxm0fiL/k1/owT3RP Z2Lrv5ojRXXkbgn2DJJPK5A97GUSMafDy8ejucI/vTma8lHFfHYGMgDeOx4DdVOI4vlZ wwr568oA3wFKLhJ5gopgjVgZDLdC556AB7ae3YcFVV2W8RIoOPahDhbqAzs7DbYoaJja ftcHtwMxH9vGZHwe5WTfdRkCVJ6iI3dGhGMIR99xsYuk+HOG8S7mUbUI/txIspyjzwth jt5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=T7a4/ETdnl/8Fs3SHKc7TnLqIRYozmBpZ1w1Le85T8g=; fh=H9/+fk2Ete/Gzpx6dba0TKFidU7mNxuKLM/h3KEx+fQ=; b=YTZulC6zUo4DeZrOOZzNwWKZCpdm0XB1lBQjCImRzFxS+WMdrmJ+u60Ju4vk7vuKTe bB6/mJstgmkLzEDxy18yIoz+4927DCN7VI5bT+iuw5E3+EzWB91iUE25qiJr1d4uB9H0 9lflf9q3LGKI2hdT/tVTSuiKrqavqFLjoO4aXoiAUiQ2YaEqILLs/zMyzx1flnZfMjgw FDrLRQz8FrsrYA2fUY0ZN55qoAyPx25BfOGpJ7eY4UdU7W50CqBJsS+1darx9XPCIlbe VPkp6MZUu7WrTQqimFsQM/X838kkOZDb6YzO7ybhW6wbXYKqT2+irUX+ifvlEjT7hyFi Z22w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lSId1XxF; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-121957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j2-20020a05620a0a4200b0078a0769d512si10695448qka.374.2024.03.27.13.06.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 13:06:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lSId1XxF; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-121957-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121957-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1C01A1C29451 for ; Wed, 27 Mar 2024 20:06:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0489153BE1; Wed, 27 Mar 2024 20:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lSId1XxF" 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 0E859153570 for ; Wed, 27 Mar 2024 20:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711569850; cv=none; b=DEWjP8tBtK0ntJO9mgq0XAi04tYFW7AUvaSeaBi1xOrs1VnDN5ljnXAGYtsUMKY5npwFz/Ce5Z9efwMZwx/4RBlmQHi1hMpVkuYGhNxur494yMSt1LkiPeLboXCtNF/8dunsdkE9NcDUjEdRaaPviHikdyiB85hi3wcXr6Fa3hU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711569850; c=relaxed/simple; bh=CLmeyEJVusEGYfnF/7WHgMN0KkjloHLy09ihZfkY5qU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YMqNNBBse3nPIjzn0+Yjn0o1r5Ev+Xaz31WQOnU/ZyVOuwcB7Oew5agDB0cpoh1HKOjhj59hfavoIUeYUKUi4VCsa4RoWIMiILtTZj4okZLEdK6eSGxJxvK04VguzTtKUnw9SryB9XmvFnPsEaVVIcXF3t6zDQC2NsRwO/wPAIw= 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=lSId1XxF; arc=none 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711569848; x=1743105848; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CLmeyEJVusEGYfnF/7WHgMN0KkjloHLy09ihZfkY5qU=; b=lSId1XxFLUzXRPXg3mYANYrMUHABwkEoYVKQnyPgwFvvd4Sy27/UgS31 7Y5wTfGYoepMp1z0N0TC3fj4Ieh2mbXWqCwtMIQ9scsF/LgM3NF3W/TIJ sXiAph0JyizP261MR9z4DoBmGH1ZFZ5I97bVdi4JDY+wivLyz5kXebEt2 4dA8bbd81BCe1mQa9rqKYz4tMmkbuN+CmDnQcPyg+6mJRoU6fwLcQ5BYF dZSk3pXZgnvUz8y4ZsJ09xvvReCTFXfQvLCCYjd20iUzORRM3DH/5LAan kHhI3kCyg3h33OZMb6VphPvobj7S8vGeCXgfaUVwZoHKk7008OMtS1j/O w==; X-CSE-ConnectionGUID: OHwZAv4bSeinI/w/OO0hOA== X-CSE-MsgGUID: /ozbtIYiTfuC7Xc3qDH4hw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="18133014" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="18133014" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 13:04:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="16246139" Received: from agluck-desk3.sc.intel.com ([172.25.222.105]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 13:04:03 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini Cc: x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH 08/10] x86/resctrl: Mark L3 monitor files with summation flag. Date: Wed, 27 Mar 2024 13:03:50 -0700 Message-ID: <20240327200352.236835-9-tony.luck@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327200352.236835-1-tony.luck@intel.com> References: <20240327200352.236835-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: 8bit When Sub-NUMA cluster mode is enabled, the parent monitor files in the mon_L3_XX directories need to sum all child siblings from the SUBL3 domains. Add a flag to the parent files and pass that down to the routines that will read values from hardware RMID counters. Signed-off-by: Tony Luck --- arch/x86/kernel/cpu/resctrl/internal.h | 5 ++++- arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 1 + arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h index 7f05502454c5..4263fbdf7ee7 100644 --- a/arch/x86/kernel/cpu/resctrl/internal.h +++ b/arch/x86/kernel/cpu/resctrl/internal.h @@ -130,6 +130,7 @@ struct mon_evt { * @priv: Used to store monitoring event data in @u * as kernfs private data * @rid: Resource id associated with the event file + * @sumdomains: Report total of all SNC domains sharing an L3 cache * @evtid: Event id associated with the event file * @domid: The domain to which the event file belongs * @u: Name of the bit fields struct @@ -137,7 +138,8 @@ struct mon_evt { union mon_data_bits { void *priv; struct { - unsigned int rid : 10; + unsigned int rid : 9; + unsigned int sumdomains : 1; enum resctrl_event_id evtid : 8; unsigned int domid : 14; } u; @@ -149,6 +151,7 @@ struct rmid_read { struct rdt_domain *d; enum resctrl_event_id evtid; bool first; + bool sumdomains; int err; u64 val; void *arch_mon_ctx; diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c index 2bf021d42500..fedcf50df6e5 100644 --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c @@ -574,6 +574,7 @@ int rdtgroup_mondata_show(struct seq_file *m, void *arg) resid = md.u.rid; domid = md.u.domid; evtid = md.u.evtid; + rr.sumdomains = md.u.sumdomains; r = &rdt_resources_all[resid].r_resctrl; d = rdt_find_domain(r, domid, NULL); diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 399dc3175292..3e7f2e36b71e 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -3059,7 +3059,8 @@ static void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r, } static int mon_add_all_files(struct kernfs_node *kn, struct rdt_domain *d, - struct rdt_resource *r, struct rdtgroup *prgrp) + struct rdt_resource *r, struct rdtgroup *prgrp, + bool sumdomains) { union mon_data_bits priv; struct mon_evt *mevt; @@ -3071,6 +3072,7 @@ static int mon_add_all_files(struct kernfs_node *kn, struct rdt_domain *d, priv.u.rid = r->rid; priv.u.domid = d->id; + priv.u.sumdomains = sumdomains; list_for_each_entry(mevt, &r->evt_list, list) { priv.u.evtid = mevt->evtid; ret = mon_addfile(kn, mevt->name, priv.priv); @@ -3109,7 +3111,7 @@ static int mkdir_mondata_subdir(struct kernfs_node *parent_kn, ret = rdtgroup_kn_set_ugid(kn); if (ret) goto out_destroy; - ret = mon_add_all_files(kn, d, r, prgrp); + ret = mon_add_all_files(kn, d, r, prgrp, true); if (ret) goto out_destroy; } @@ -3124,7 +3126,7 @@ static int mkdir_mondata_subdir(struct kernfs_node *parent_kn, if (ret) goto out_destroy; - ret = mon_add_all_files(ckn, d, r, prgrp); + ret = mon_add_all_files(ckn, d, r, prgrp, false); if (ret) goto out_destroy; kernfs_activate(kn); -- 2.44.0