Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp80503rdb; Fri, 29 Sep 2023 17:48:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRvE2Mu0J2WPNcQIrgXi5LC/6imPnqlFUfdP3BydYx9tWd1qoO74tMdFkQ2g+dVFnHazgX X-Received: by 2002:a05:6830:1d6b:b0:6c5:233:fc28 with SMTP id l11-20020a0568301d6b00b006c50233fc28mr6439497oti.33.1696034916541; Fri, 29 Sep 2023 17:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696034916; cv=none; d=google.com; s=arc-20160816; b=Rq/7FUAJZEnzlxsHPx8Uss0AwKX5fMDZWfjzWcrUor762DzARMVvOTKp59Ga6icNJz 1lZsA+ADr6niJWh7Yu80J6ZFPZ9wEZdyYLzqvOXD6y59MPWhFPySZWg17AZEQmOu3PwI J13UG/Gnakr9jn81LAcK9xZSoQHc7iFNMM/YDY+uzUYW0bqZSBwchSYnOFFsuY9O4Tri /bbEgNRoV1J4mSyj6e+I5v5B9YRvR/VVjYkSRF+2uT/zF68rrAyMGgb8QPWeQ+ZmL1wH 8NVQyhhaWo9Xd3y1egY1YNp79h5rbjR6oeq7EPwYNpl/Ro+KLkiHUe2qGovL+YPW8FjC w/Vw== 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=zIeTHYsyqJu0vQezr3NfN+YRoCTqVLdVTfRWqQ5v/NY=; fh=aJ6lOWeHWzkfLwCbWv1l1G4TXS4aXPfLr1URzCnDOG8=; b=lZom4xPDPJaijhCQKs/7ZDVYBLv5daOfsFMYvMR6CxDnuAN+4FEHW4HPw9khXIMQK0 3BxsWLQKMFlm3Zu0+QJEbBQEicRbOAEZp+N4Y1fpgbFz9m40+W4fpo96Uvo9NVn+D9kI RZz2FdvVZZOu/F6Tt8mY0vPdEp16XdYhFFG9FOCnR5soqpK1l29OTejnLO1qqrDe0Evo Trhkac22fP5zKlO9OQ5208g9Mv7e4bW6GfZYqpgJyQUQppv3cdHP8AUnrIsXAz4mS9EJ lqg4rjHP9sMj7Tcqri2BI8nkoMASYlOmUUmI6/bFAaSsTcSrAuXzA/fnkNgQm7F67yd1 yltQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XPKaQke6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id r9-20020a632b09000000b00573f837821fsi21305658pgr.689.2023.09.29.17.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 17:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XPKaQke6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 32B2080A220C; Fri, 29 Sep 2023 08:26:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233634AbjI2PZ4 (ORCPT + 99 others); Fri, 29 Sep 2023 11:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233517AbjI2PZy (ORCPT ); Fri, 29 Sep 2023 11:25:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A64FF7; Fri, 29 Sep 2023 08:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696001152; x=1727537152; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=M20ejqqOgKLj/KDTmG8TFlSsEsdSjuI0oU4rBfV71jA=; b=XPKaQke6BEEnRMG7jc5Pog/I+fmEFUxQolzTHCN9mtnPD+8fifxBDI91 IU4x7FeJ+u1d7bxPKwNvB50mI7ckK7QOcRUhRsCftgIirJAkXfOyCm2fa k9pXpRwFjEz1Wv+LTRo9FhDTXC+Y+3hWLD109yQ4rXkNkkcGphjeTQPBz BF1yvUY+/XuYtTo4AB0gZo3lucDnPUMuoRP02Qy/siSTsnmcV1e/AKhH+ Gxpo6UHmu+KJN8WqyJJoN+Nep2BY70OvxnWSePv/F/Lur3pLCRU/ZyHFy 3O9RAokTBnukZvSyIqo5eT+51DuNzIGuYHX/QluIPiv0T66FLiyYXw3Vk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="367377054" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="367377054" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:25:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10848"; a="753411168" X-IronPort-AV: E=Sophos;i="6.03,187,1694761200"; d="scan'208";a="753411168" Received: from smorozov-mobl1.ger.corp.intel.com ([10.252.52.167]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2023 08:25:43 -0700 Date: Fri, 29 Sep 2023 18:25:40 +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 07/10] x86/resctrl: Introduce "-o debug" mount option In-Reply-To: <20230915224227.1336967-8-babu.moger@amd.com> Message-ID: References: <20230915224227.1336967-1-babu.moger@amd.com> <20230915224227.1336967-8-babu.moger@amd.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-452488885-1696001150=: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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 08:26:07 -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-452488885-1696001150=:1989 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Fri, 15 Sep 2023, Babu Moger wrote: > Add "-o debug" option to mount resctrl filesystem in debug mode. > When in debug mode resctrl displays files that have the new > RFTYPE_DEBUG flag to help resctrl debugging. > > Reviewed-by: Reinette Chatre > Reviewed-by: Fenghua Yu > Signed-off-by: Babu Moger > --- > Documentation/arch/x86/resctrl.rst | 5 ++++- > arch/x86/kernel/cpu/resctrl/internal.h | 2 ++ > arch/x86/kernel/cpu/resctrl/rdtgroup.c | 18 ++++++++++++++++++ > 3 files changed, 24 insertions(+), 1 deletion(-) > > diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst > index 8154e9975d1e..28d35aaa74b4 100644 > --- a/Documentation/arch/x86/resctrl.rst > +++ b/Documentation/arch/x86/resctrl.rst > @@ -35,7 +35,7 @@ about the feature from resctrl's info directory. > > To use the feature mount the file system:: > > - # mount -t resctrl resctrl [-o cdp[,cdpl2][,mba_MBps]] /sys/fs/resctrl > + # mount -t resctrl resctrl [-o cdp[,cdpl2][,mba_MBps][,debug]] /sys/fs/resctrl > > mount options are: > > @@ -46,6 +46,9 @@ mount options are: > "mba_MBps": > Enable the MBA Software Controller(mba_sc) to specify MBA > bandwidth in MBps > +"debug": > + Make debug files accessible. Available debug files are annotated with > + "Available only with debug option". > > L2 and L3 CDP are controlled separately. > > diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h > index 14988c9f402c..68d1b7147291 100644 > --- a/arch/x86/kernel/cpu/resctrl/internal.h > +++ b/arch/x86/kernel/cpu/resctrl/internal.h > @@ -59,6 +59,7 @@ struct rdt_fs_context { > bool enable_cdpl2; > bool enable_cdpl3; > bool enable_mba_mbps; > + bool enable_debug; > }; > > static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc) > @@ -306,6 +307,7 @@ struct rdtgroup { > #define RFTYPE_TOP BIT(6) > #define RFTYPE_RES_CACHE BIT(8) > #define RFTYPE_RES_MB BIT(9) > +#define RFTYPE_DEBUG BIT(10) > #define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL) > #define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON) > #define RFTYPE_TOP_INFO (RFTYPE_INFO | RFTYPE_TOP) > diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > index a34657f0bd0c..150105c21fee 100644 > --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c > +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c > @@ -59,6 +59,8 @@ static void rdtgroup_destroy_root(void); > > struct dentry *debugfs_resctrl; > > +static bool resctrl_debug; > + > void rdt_last_cmd_clear(void) > { > lockdep_assert_held(&rdtgroup_mutex); > @@ -1874,6 +1876,9 @@ static int rdtgroup_add_files(struct kernfs_node *kn, unsigned long fflags) > > lockdep_assert_held(&rdtgroup_mutex); > > + if (resctrl_debug) > + fflags |= RFTYPE_DEBUG; > + > for (rft = rfts; rft < rfts + len; rft++) { > if (rft->fflags && ((fflags & rft->fflags) == rft->fflags)) { > ret = rdtgroup_add_file(kn, rft); > @@ -2377,6 +2382,8 @@ static void rdt_disable_ctx(void) > resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L3, false); > resctrl_arch_set_cdp_enabled(RDT_RESOURCE_L2, false); > set_mba_sc(false); > + > + resctrl_debug = false; > } > > static int rdt_enable_ctx(struct rdt_fs_context *ctx) > @@ -2401,6 +2408,9 @@ static int rdt_enable_ctx(struct rdt_fs_context *ctx) > goto out_cdpl3; > } > > + if (ctx->enable_debug) > + resctrl_debug = true; > + > return 0; > > out_cdpl3: > @@ -2605,6 +2615,7 @@ enum rdt_param { > Opt_cdp, > Opt_cdpl2, > Opt_mba_mbps, > + Opt_debug, > nr__rdt_params > }; > > @@ -2612,6 +2623,7 @@ static const struct fs_parameter_spec rdt_fs_parameters[] = { > fsparam_flag("cdp", Opt_cdp), > fsparam_flag("cdpl2", Opt_cdpl2), > fsparam_flag("mba_MBps", Opt_mba_mbps), > + fsparam_flag("debug", Opt_debug), > {} > }; > > @@ -2637,6 +2649,9 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param) > return -EINVAL; > ctx->enable_mba_mbps = true; > return 0; > + case Opt_debug: > + ctx->enable_debug = true; > + return 0; > } > > return -EINVAL; > @@ -3705,6 +3720,9 @@ static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) > if (is_mba_sc(&rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl)) > seq_puts(seq, ",mba_MBps"); > > + if (resctrl_debug) > + seq_puts(seq, ",debug"); > + > return 0; > } > > Reviewed-by: Ilpo J?rvinen -- i. --8323329-452488885-1696001150=:1989--