Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4112443rdh; Fri, 29 Sep 2023 11:25:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaZEMiIha/Z5oEgK79EZcU5u4aS1JjtFI5IueziTDkK7bgCR5aZcDFJ3lMcE7KTJrp2V9h X-Received: by 2002:a17:902:ecca:b0:1c0:cbaf:6954 with SMTP id a10-20020a170902ecca00b001c0cbaf6954mr8128578plh.25.1696011929933; Fri, 29 Sep 2023 11:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696011929; cv=none; d=google.com; s=arc-20160816; b=oVyms0V5pCOXs096CEERqy+BXt8/zDCmdrF51fC56K+a4nXd+3KnJd1cUBje0PHt17 jb1NDGcq0j0sTPc1/bE16OuxCJAGPd/ZQ6f9jtSwESeDVp8oCRSqZs4wfc/AuqpbLH2V bZv1YS1fAWdVkY3E6BLbV+xnzXoem/CwWDJjCSEb9DVjbDD7t/xqhP7kh0WpyXsmqSV8 q77jVnelN66SuohOffPLxME8uIuLBtGNidYAlza4BYZoxJZndlxu4q+UeDIjoMA7YbCb vwiJSvzfDpNMaKTA3NXjDx7oNv6/6jdsm5Q++E90zPpKfphjO97TIkhC5f63RzaV/Lyx fhpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=15/cy6nIRWNKufe2suRnh0WhxHwK/nRmrmBlFMetcRE=; fh=aJ6lOWeHWzkfLwCbWv1l1G4TXS4aXPfLr1URzCnDOG8=; b=w5iS1qPEOVBGfXghB3Vp78/aRItuZoAlwQKmgLmGkux9dimmjD80M1yzGeQXeYKfqy wnKnGrUfBB53pHdW6FcrH3/7Q2mWNJK7lY8qyNHgxIZXmlTYoC3PHAfsuEYmBW9w0r5h 3M024vXO/PSneLdlZQR4V/c/dsuHvcE4vm1UImR7rfecnefgZC0x3IkVjTkaCWBqJn2I d+8yORio242KLiY3qHom1NMK5kwqby6HVYeF9uarhirQiWIY0o65xfC5WogpHY8mvaEP PrjA0Lh0vZCphUhYbQMR+4HJS63TMuOPofxT9Gen+Bwp+UaYxWHjdctpSCCfxKxRmk3c f2MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cq9f8kHN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b17-20020a170903229100b001c61ad51779si14953151plh.623.2023.09.29.11.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cq9f8kHN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id DE3AF811338B; Fri, 29 Sep 2023 08:57:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233717AbjI2P5Y (ORCPT + 99 others); Fri, 29 Sep 2023 11:57:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbjI2P5X (ORCPT ); Fri, 29 Sep 2023 11:57:23 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7FB3195; Fri, 29 Sep 2023 08:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696003040; x=1727539040; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=QuNwZ8GGaC1YVteAi2IZNrp5mEpQR8V4HvTYvdoFsDI=; b=cq9f8kHNxsheRK5rI/AWRoYYv2SU/AlPY7SptZiZhY5N4223AFkFOq3S 0U/DrviyrMYb5aBZy6nZnxETYAW2GMBvqd9bg2Reb/5CFGogSZaArqAFI S754bq0VuTeG23JhWV3k6Cz7yXscaHtlZsZ2cB9kGWxyCeozOu/owWGnp aAXeDBQEhLKuSxbaw1BpsDG8DSppzjKZE4i1S41ypEaBdeyEu7JZFoRi3 4+1zRTq1uuX/X1ZN+98VnGrs6bhVX5c4+i6zzdhS/RdVG4D9JSM33+mvv 9roY+LgOPhhNUKIkZMuhH2cawHCRCj52GqIgRTuttWzuN2U3YS1N/KBhW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="385149712" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="385149712" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:56:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="923633407" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="923633407" Received: from smorozov-mobl1.ger.corp.intel.com ([10.252.52.167]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:56:40 -0700 Date: Fri, 29 Sep 2023 18:56:37 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Babu Moger cc: corbet@lwn.net, Reinette Chatre , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, fenghua.yu@intel.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, paulmck@kernel.org, akpm@linux-foundation.org, quic_neeraju@quicinc.com, rdunlap@infradead.org, damien.lemoal@opensource.wdc.com, songmuchun@bytedance.com, peterz@infradead.org, jpoimboe@kernel.org, pbonzini@redhat.com, chang.seok.bae@intel.com, pawan.kumar.gupta@linux.intel.com, jmattson@google.com, daniel.sneddon@linux.intel.com, sandipan.das@amd.com, tony.luck@intel.com, james.morse@arm.com, linux-doc@vger.kernel.org, LKML , bagasdotme@gmail.com, eranian@google.com, christophe.leroy@csgroup.eu, jarkko@kernel.org, adrian.hunter@intel.com, quic_jiles@quicinc.com, peternewman@google.com Subject: Re: [PATCH v10 10/10] x86/resctrl: Display RMID of resource group In-Reply-To: <20230915224227.1336967-11-babu.moger@amd.com> Message-ID: <0f97fcf-ee2e-f63f-1d98-8e11d30384c@linux.intel.com> References: <20230915224227.1336967-1-babu.moger@amd.com> <20230915224227.1336967-11-babu.moger@amd.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-894282230-1696003007=:1989" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:57:42 -0700 (PDT) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-894282230-1696003007=:1989 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Fri, 15 Sep 2023, Babu Moger wrote: > In x86, hardware uses RMID to identify a monitoring group. When a user > creates a monitor group these details are not visible. These details > can help resctrl debugging. > > Add RMID(mon_hw_id) to the monitor groups display in resctrl interface. > Users can see these details when resctrl is mounted with "-o debug" option. > > Other architectures do not use "RMID". Use the name mon_hw_id to refer > to "RMID" in an effort to keep the naming generic. > > For example: > $cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id > 3 > > Signed-off-by: Babu Moger > --- > Documentation/arch/x86/resctrl.rst | 4 ++++ > arch/x86/kernel/cpu/resctrl/internal.h | 5 +++++ > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 23 +++++++++++++++++++++++ > 3 files changed, 32 insertions(+) > > diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst > index 54691c8b832d..98b0eb509ed4 100644 > --- a/Documentation/arch/x86/resctrl.rst > +++ b/Documentation/arch/x86/resctrl.rst > @@ -369,6 +369,10 @@ When monitoring is enabled all MON groups will also contain: > the sum for all tasks in the CTRL_MON group and all tasks in > MON groups. Please see example section for more details on usage. > > +"mon_hw_id": > + Available only with debug option. The identifier used by hardware > + for the monitor group. On x86 this is the RMID. > + > Resource allocation rules > ------------------------- > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index a07fa4329b65..b4910892b0a6 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -296,6 +296,11 @@ struct rdtgroup { > * --> RFTYPE_BASE (Files common for both MON and CTRL groups) > * Files: cpus, cpus_list, tasks > * > + * --> RFTYPE_MON (Files only for MON group) > + * > + * --> RFTYPE_DEBUG (Files to help resctrl debugging) > + * File: mon_hw_id > + * > * --> RFTYPE_CTRL (Files only for CTRL group) > * Files: mode, schemata, size > * > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 55d1b90f460e..ef4b18091e5d 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -795,6 +795,22 @@ static int rdtgroup_closid_show(struct kernfs_open_file *of, > return ret; > } > > +static int rdtgroup_rmid_show(struct kernfs_open_file *of, > + struct seq_file *s, void *v) > +{ > + struct rdtgroup *rdtgrp; > + int ret = 0; > + > + rdtgrp = rdtgroup_kn_lock_live(of->kn); > + if (rdtgrp) > + seq_printf(s, "%u\n", rdtgrp->mon.rmid); > + else > + ret = -ENOENT; > + rdtgroup_kn_unlock(of->kn); > + > + return ret; > +} > + > #ifdef CONFIG_PROC_CPU_RESCTRL > > /* > @@ -1856,6 +1872,13 @@ static struct rftype res_common_files[] = { > .seq_show = rdtgroup_tasks_show, > .fflags = RFTYPE_BASE, > }, > + { > + .name = "mon_hw_id", > + .mode = 0444, > + .kf_ops = &rdtgroup_kf_single_ops, > + .seq_show = rdtgroup_rmid_show, > + .fflags = RFTYPE_MON_BASE | RFTYPE_DEBUG, > + }, > { > .name = "schemata", > .mode = 0644, > Reviewed-by: Ilpo J?rvinen -- i. --8323329-894282230-1696003007=:1989--