Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4107205rdh; Fri, 29 Sep 2023 11:14:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEegz4TRbgxXY2QaxeNL1fVcbKIwf6WoyYmZ5XwmtAjkS3wyRXuMU2OdjfqQMb3bSlHiN+E X-Received: by 2002:a05:6870:eca7:b0:1bf:e522:7133 with SMTP id eo39-20020a056870eca700b001bfe5227133mr5871697oab.38.1696011287311; Fri, 29 Sep 2023 11:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696011287; cv=none; d=google.com; s=arc-20160816; b=qIqPQ93QhZL2e7fcif/solFj8raDZNLYDUJ+4RGIFAQDc/vkbDIi+b/QjcBY4zBYL9 9h4XHoUZED9s8Yd1xxsBnxN2rCXjcfEfLdsGWeH0iUH0wUZDjB0Vvr1DQv70OlUNDhT6 JytYKMLS/onuGMBz8c2oCzzEGkWV+/Vo6RwNeAGTEZZwAi3Oym7GN6p3gAZRicKpopzu J356pkbVZkBL0xc0jg+7t5QjKPO31fz5nkEYFHkk3d/3Alj+3wycf5gRLducyB22iPmC zAWRRl+/OZvDwU1P3Ca5dYCSGeWh1Oej2s9zfZ6UuRR6JbwoPe09mIfjgPxua08Hh9N1 r7PA== 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=3WepgpT3Ej4ImbbSgVeUTm9vKuZgWIe980UXSN4CCrM=; fh=WQLaXCxGgtjzWRx7jc79MYWROkX7XXyjltyvcK6b7nI=; b=R78LRucdsCTCWqXDYjFhjhpe9PclqOV39EsLIx/aFH02PzMunMfyru/acuURb6RnZa f/qfUNT2iSf19Jov2fqK2phlY9VQ6yLl4KVgzQU6+XVhpbr867JX/Db6EhB9/Z6XS1xp +viuTwEuzW+PWQDFXhJsUXDoPJRGs/y/xUtPEBDLDr8STo4zHhv0LA1FVVSiPkp5zNec xuigF8I3KebFvZ9c5/34A2QrYEGT0QjaibjsOByejdNMe340N6dbnY0eSEzrsiZokHKD AIlzl3UWnkXf0AowTLZoQx8Xv+zUj6ZFFdl3EE2ThMJ0bPOO5LNz8QVtuhecSV1AyYOj fmzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O0yvMlry; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id z126-20020a633384000000b00584af407e80si10794020pgz.293.2023.09.29.11.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 11:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=O0yvMlry; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 110E580B3B71; Fri, 29 Sep 2023 08:41:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233705AbjI2Pks (ORCPT + 99 others); Fri, 29 Sep 2023 11:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbjI2Pkm (ORCPT ); Fri, 29 Sep 2023 11:40:42 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8D7CB4; Fri, 29 Sep 2023 08:40:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696002040; x=1727538040; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=MyboEM7UH8s3FHhQHPjmv8x4en1uRLADS8XT/N5vA3E=; b=O0yvMlryMWRiBy4lKzsrUy1yfGw9h6GQqixmQeF9CWPoOfdoaBgQ4+I1 KfmYddnIQ6TRuXPB6EQ7+Mnnqy2o+eAuQP90wtWDnb2/ah8HSd7PeT+f+ twNaJHHDfinZGZV3urvfDApj2qUlIdf+Qp28/7377KZcyPq0Z5Ckvbub1 SknB03AUpwZLDelXI9BEK8rki549ms1S0riOMgK25OQ5B8+0yED3ySKqe 5o4M3AaBmzyXstSPLIoHnfKj6WaaQZgChJwo20UfCr64BK0UxN8NBLyef gNkeHlAPk7gnEvjWZlKrFSFNdB2RlxosGhOebED0GBKB5cPlw2MgBNYR5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="361703264" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="361703264" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:40:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="815644202" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="815644202" Received: from smorozov-mobl1.ger.corp.intel.com ([10.252.52.167]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:40:32 -0700 Date: Fri, 29 Sep 2023 18:40:29 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Babu Moger cc: corbet@lwn.net, reinette.chatre@intel.com, 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, linux-kernel@vger.kernel.org, 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 08/10] x86/resctrl: Display CLOSID for resource group In-Reply-To: <20230915224227.1336967-9-babu.moger@amd.com> Message-ID: <77ffcd20-7bae-2017-a0d8-865d13434658@linux.intel.com> References: <20230915224227.1336967-1-babu.moger@amd.com> <20230915224227.1336967-9-babu.moger@amd.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1951734013-1696002039=: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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:41:20 -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-1951734013-1696002039=: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 CLOSID to identify a control group. When a user > creates a control group this information is not visible to the user. > It can help resctrl debugging. > > Add CLOSID(ctrl_hw_id) to the control groups display in resctrl > interface. Users can see this detail when resctrl is mounted with > "-o debug" option. > > Other architectures do not use "CLOSID". Use the names ctrl_hw_id > to refer to "CLOSID" in an effort to keep the naming generic. > > For example: > $cat /sys/fs/resctrl/ctrl_grp1/ctrl_hw_id > 1 > > Signed-off-by: Babu Moger > --- > Documentation/arch/x86/resctrl.rst | 4 ++++ > arch/x86/kernel/cpu/resctrl/internal.h | 3 +++ > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 23 +++++++++++++++++++++++ > 3 files changed, 30 insertions(+) > > diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst > index 28d35aaa74b4..54691c8b832d 100644 > --- a/Documentation/arch/x86/resctrl.rst > +++ b/Documentation/arch/x86/resctrl.rst > @@ -352,6 +352,10 @@ When control is enabled all CTRL_MON groups will also contain: > file. On successful pseudo-locked region creation the mode will > automatically change to "pseudo-locked". > > +"ctrl_hw_id": > + Available only with debug option. The identifier used by hardware > + for the control group. On x86 this is the CLOSID. > + > When monitoring is enabled all MON groups will also contain: > > "mon_data": > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index 68d1b7147291..a07fa4329b65 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -299,6 +299,9 @@ struct rdtgroup { > * --> RFTYPE_CTRL (Files only for CTRL group) > * Files: mode, schemata, size > * > + * --> RFTYPE_DEBUG (Files to help resctrl debugging) > + * File: ctrl_hw_id > + * > */ > #define RFTYPE_INFO BIT(0) > #define RFTYPE_BASE BIT(1) > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index 150105c21fee..953b082cec8a 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -779,6 +779,22 @@ static int rdtgroup_tasks_show(struct kernfs_open_file *of, > return ret; > } > > +static int rdtgroup_closid_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->closid); > + else > + ret = -ENOENT; > + rdtgroup_kn_unlock(of->kn); > + > + return ret; > +} > + > #ifdef CONFIG_PROC_CPU_RESCTRL > > /* > @@ -1863,6 +1879,13 @@ static struct rftype res_common_files[] = { > .seq_show = rdtgroup_size_show, > .fflags = RFTYPE_CTRL_BASE, > }, > + { > + .name = "ctrl_hw_id", > + .mode = 0444, > + .kf_ops = &rdtgroup_kf_single_ops, > + .seq_show = rdtgroup_closid_show, > + .fflags = RFTYPE_CTRL_BASE | RFTYPE_DEBUG, > + }, > > }; Reviewed-by: Ilpo J?rvinen -- i. --8323329-1951734013-1696002039=:1989--