From: Fenghua Yu <fenghua.yu@intel.com>
To: Babu Moger <babu.moger@amd.com>, <reinette.chatre@intel.com>
Cc: <tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <x86@kernel.org>, <hpa@zytor.com>,
<corbet@lwn.net>, <linux-kernel@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <eranian@google.com>,
<peternewman@google.com>
Subject: Re: [RFC v2 PATCH 5/7] x86/resctrl: Introduce -o debug mount option
Date: Thu, 16 Feb 2023 17:42:43 -0800 [thread overview]
Message-ID: <04a598d8-eeee-9512-7db9-cfeae33999a7@intel.com> (raw)
In-Reply-To: <167537444491.647488.11815488030989406143.stgit@bmoger-ubuntu>
Hi, Babu,
On 2/2/23 13:47, Babu Moger wrote:
> Add -o debug option to mount resctrl filesystem in debug mode. Debug
> option adds the files for debug purposes.
>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---
> Documentation/x86/resctrl.rst | 2 ++
> arch/x86/kernel/cpu/resctrl/internal.h | 1 +
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 7 +++++++
> 3 files changed, 10 insertions(+)
>
> diff --git a/Documentation/x86/resctrl.rst b/Documentation/x86/resctrl.rst
> index 58b76fc75cb7..2c013c5d45fd 100644
> --- a/Documentation/x86/resctrl.rst
> +++ b/Documentation/x86/resctrl.rst
> @@ -46,6 +46,8 @@ mount options are:
> "mba_MBps":
> Enable the MBA Software Controller(mba_sc) to specify MBA
> bandwidth in MBps
> +"debug":
> + Lists the debug files in resctrl interface
>
> 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 6767c85b9699..35a9ee343fe0 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 debug;
> };
>
> static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc)
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index 18d458a3cba6..9b7813aa6baf 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -2555,6 +2555,7 @@ enum rdt_param {
> Opt_cdp,
> Opt_cdpl2,
> Opt_mba_mbps,
> + Opt_debug,
> nr__rdt_params
> };
>
> @@ -2562,6 +2563,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),
> {}
> };
>
> @@ -2587,6 +2589,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->debug = true;
> + return 0;
> }
>
> return -EINVAL;
> @@ -3525,6 +3530,8 @@ 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");
>
> + seq_puts(seq, ",debug");
Need to add a check here otherwise ",debug" will be always shown
regardless "-o debug" is given or not:
+ if (ctx->debug)
+ seq_puts(seq, ",debug");
But I don't know a good way to get ctx->debug in this function yet. I
think somehow ctx can be retrieved from kf but not sure.
> +
> return 0;
> }
>
>
>
Thanks.
-Fenghua
next prev parent reply other threads:[~2023-02-17 1:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 21:46 [RFC v2 PATCH 0/7] x86/resctrl: Miscellaneous resctrl features Babu Moger
2023-02-02 21:46 ` [RFC v2 PATCH 1/7] x86/resctrl: Add multiple tasks to the resctrl group at once Babu Moger
2023-02-16 22:27 ` Fenghua Yu
2023-02-17 15:05 ` Moger, Babu
2023-02-02 21:47 ` [RFC v2 PATCH 2/7] x86/resctrl: Remove few unnecessary rftype flags Babu Moger
2023-02-02 21:47 ` [RFC v2 PATCH 3/7] x86/resctrl: Rename rftype flags for consistency Babu Moger
2023-02-02 21:47 ` [RFC v2 PATCH 4/7] x86/resctrl: Re-arrange RFTYPE flags based on hierarchy Babu Moger
2023-02-02 21:47 ` [RFC v2 PATCH 5/7] x86/resctrl: Introduce -o debug mount option Babu Moger
2023-02-17 1:42 ` Fenghua Yu [this message]
2023-02-17 17:29 ` Moger, Babu
2023-02-02 21:47 ` [RFC v2 PATCH 6/7] x86/resctrl: Display the RMID and COSID for resctrl groups Babu Moger
2023-02-17 1:46 ` Fenghua Yu
2023-02-17 17:39 ` Moger, Babu
2023-02-02 21:47 ` [RFC v2 PATCH 7/7] x86/resctrl: Add debug files when mounted with debug option Babu Moger
2023-02-17 1:50 ` Fenghua Yu
2023-02-17 17:49 ` Moger, Babu
2023-02-16 18:05 ` [RFC v2 PATCH 0/7] x86/resctrl: Miscellaneous resctrl features Moger, Babu
2023-02-16 22:13 ` Reinette Chatre
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=04a598d8-eeee-9512-7db9-cfeae33999a7@intel.com \
--to=fenghua.yu@intel.com \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peternewman@google.com \
--cc=reinette.chatre@intel.com \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®