From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Babu Moger <babu.moger@amd.com>
Cc: corbet@lwn.net, Reinette Chatre <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, LKML <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 07/10] x86/resctrl: Introduce "-o debug" mount option
Date: Fri, 29 Sep 2023 18:25:40 +0300 (EEST) [thread overview]
Message-ID: <aa0a87c-e00-9cf2-b76f-bd3bbde84519@linux.intel.com> (raw)
In-Reply-To: <20230915224227.1336967-8-babu.moger@amd.com>
[-- Attachment #1: Type: text/plain, Size: 4585 bytes --]
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 <reinette.chatre@intel.com>
> Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---
> 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 <ilpo.jarvinen@linux.intel.com>
--
i.
next prev parent reply other threads:[~2023-09-29 15:25 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 22:42 [PATCH v10 00/10] x86/resctrl: Miscellaneous resctrl features Babu Moger
2023-09-15 22:42 ` [PATCH v10 01/10] x86/resctrl: Add multiple tasks to the resctrl group at once Babu Moger
2023-09-27 18:30 ` Reinette Chatre
2023-09-27 21:44 ` Moger, Babu
2023-09-27 22:20 ` Reinette Chatre
2023-09-29 15:08 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 02/10] x86/resctrl: Simplify rftype flag definitions Babu Moger
2023-09-29 15:09 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 03/10] x86/resctrl: Rename rftype flags for consistency Babu Moger
2023-09-25 21:16 ` Fenghua Yu
2023-09-27 18:31 ` Reinette Chatre
2023-09-27 21:51 ` Moger, Babu
2023-09-29 15:14 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 04/10] x86/resctrl: Add comments on RFTYPE flags hierarchy Babu Moger
2023-09-29 15:17 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 05/10] x86/resctrl: Unwind the errors inside rdt_enable_ctx() Babu Moger
2023-09-29 15:22 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 06/10] x86/resctrl: Move default group file creation to mount Babu Moger
2023-09-29 15:50 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 07/10] x86/resctrl: Introduce "-o debug" mount option Babu Moger
2023-09-29 15:25 ` Ilpo Järvinen [this message]
2023-09-15 22:42 ` [PATCH v10 08/10] x86/resctrl: Display CLOSID for resource group Babu Moger
2023-09-25 21:19 ` Fenghua Yu
2023-09-27 18:32 ` Reinette Chatre
2023-09-29 15:40 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 09/10] x86/resctrl: Add support for the files for MON groups only Babu Moger
2023-09-25 21:20 ` Fenghua Yu
2023-09-27 18:34 ` Reinette Chatre
2023-09-27 21:34 ` Moger, Babu
2023-09-27 22:02 ` Reinette Chatre
2023-10-02 17:26 ` Moger, Babu
2023-09-29 15:59 ` Ilpo Järvinen
2023-09-15 22:42 ` [PATCH v10 10/10] x86/resctrl: Display RMID of resource group Babu Moger
2023-09-22 14:36 ` Peter Newman
2023-09-22 15:49 ` Moger, Babu
2023-09-22 17:59 ` Fenghua Yu
2023-09-25 8:10 ` Peter Newman
2023-09-25 21:21 ` Fenghua Yu
2023-09-27 18:35 ` Reinette Chatre
2023-09-29 15:56 ` Ilpo Järvinen
2023-09-28 5:28 ` [PATCH v10 00/10] x86/resctrl: Miscellaneous resctrl features Shaopeng Tan (Fujitsu)
2023-09-28 14:21 ` Moger, Babu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa0a87c-e00-9cf2-b76f-bd3bbde84519@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=adrian.hunter@intel.com \
--cc=akpm@linux-foundation.org \
--cc=babu.moger@amd.com \
--cc=bagasdotme@gmail.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=christophe.leroy@csgroup.eu \
--cc=corbet@lwn.net \
--cc=damien.lemoal@opensource.wdc.com \
--cc=daniel.sneddon@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=eranian@google.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=jarkko@kernel.org \
--cc=jmattson@google.com \
--cc=jpoimboe@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peternewman@google.com \
--cc=peterz@infradead.org \
--cc=quic_jiles@quicinc.com \
--cc=quic_neeraju@quicinc.com \
--cc=rdunlap@infradead.org \
--cc=reinette.chatre@intel.com \
--cc=sandipan.das@amd.com \
--cc=songmuchun@bytedance.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).