From: Babu Moger <babu.moger@amd.com>
To: Reinette Chatre <reinette.chatre@intel.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"fenghua.yu@intel.com" <fenghua.yu@intel.com>,
"bp@alien8.de" <bp@alien8.de>,
"tony.luck@intel.com" <tony.luck@intel.com>
Cc: "kuo-lang.tseng@intel.com" <kuo-lang.tseng@intel.com>,
"ravi.v.shankar@intel.com" <ravi.v.shankar@intel.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH V3 3/4] x86/resctrl: Enable per-thread MBA
Date: Thu, 14 May 2020 14:04:27 -0500 [thread overview]
Message-ID: <bb5b518c-2a10-1e0b-9c7d-29e58093a04a@amd.com> (raw)
In-Reply-To: <3510244af29b7443221dc926745fd0cf541576e0.1588808538.git.reinette.chatre@intel.com>
> -----Original Message-----
> From: Reinette Chatre <reinette.chatre@intel.com>
> Sent: Wednesday, May 6, 2020 6:50 PM
> To: tglx@linutronix.de; fenghua.yu@intel.com; bp@alien8.de;
> tony.luck@intel.com
> Cc: kuo-lang.tseng@intel.com; ravi.v.shankar@intel.com; mingo@redhat.com;
> Moger, Babu <Babu.Moger@amd.com>; hpa@zytor.com; x86@kernel.org;
> linux-kernel@vger.kernel.org; Reinette Chatre <reinette.chatre@intel.com>
> Subject: [PATCH V3 3/4] x86/resctrl: Enable per-thread MBA
>
> From: Fenghua Yu <fenghua.yu@intel.com>
>
> Current Memory Bandwidth Allocation (MBA) hardware has a limitation:
> all threads on the same core must have the same delay value. If there
> are different delay values across threads on one core, the original
> MBA implementation allocates the max delay value to the core and an
> updated implementation allocates either min or max delay value specified
> by a configuration MSR across threads on the core.
>
> Newer systems support per-thread MBA such that each thread is allocated
> with its own delay value.
>
> If per-thread MBA is supported, report "per-thread" in resctrl file
> "info/MB/thread_throttle_mode" to let user applications know memory
> bandwidth is allocated per thread and help them fine tune MBA on thread
> level.
>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
> Changes since V2:
> - Fix rST formatting of documentation (resctrl_ui.rst) describing
> new "thread_throttle_mode" resctrl file.
> - Use boot_cpu_has() instead of static_cpu_has() when determining what
> to display to user (slow path).
>
> Documentation/x86/resctrl_ui.rst | 3 +++
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 11 +++++++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/Documentation/x86/resctrl_ui.rst
> b/Documentation/x86/resctrl_ui.rst
> index 861ee2816470..1b066d1aafad 100644
> --- a/Documentation/x86/resctrl_ui.rst
> +++ b/Documentation/x86/resctrl_ui.rst
> @@ -150,6 +150,9 @@ with respect to allocation:
> "max":
> the smallest percentage is applied
> to all threads
> + "per-thread":
> + bandwidth percentages are directly applied to
> + the threads running on the core
>
> If RDT monitoring is available there will be an "L3_MON" directory
> with the following files:
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index 6a9408060ac4..c60a3b307f7d 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -1038,12 +1038,23 @@ static int max_threshold_occ_show(struct
> kernfs_open_file *of,
> * with the maximum delay value that from the software interface will be
> * the minimum of the bandwidth percentages assigned to the hardware threads
> * sharing the core.
> + *
> + * Some systems (identified by X86_FEATURE_PER_THREAD_MBA enumerated
> via CPUID)
> + * support per-thread MBA. On these systems hardware doesn't apply the
> minimum
> + * or maximum delay value to all threads in a core. Instead, a thread is
> + * allocated with the delay value that is assigned to the thread.
> */
> static int rdt_thread_throttle_mode_show(struct kernfs_open_file *of,
> struct seq_file *seq, void *v)
> {
> unsigned int throttle_mode = 0;
>
> + if (boot_cpu_has(X86_FEATURE_PER_THREAD_MBA)) {
> + seq_puts(seq, "per-thread\n");
> +
You probably don't need an extra line here.
> + return 0;
> + }
> +
> if (mba_cfg_supports_min_max_intel())
> throttle_mode = mba_cfg_msr &
> MBA_THROTTLE_MODE_MASK;
>
> --
> 2.21.0
next prev parent reply other threads:[~2020-05-14 19:04 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 23:49 [PATCH V3 0/4] x86/resctrl: Enable user to view and select thread throttling mode Reinette Chatre
2020-05-06 23:49 ` [PATCH V3 1/4] " Reinette Chatre
2020-05-14 16:45 ` Babu Moger
2020-05-14 18:10 ` Reinette Chatre
2020-05-14 20:06 ` Babu Moger
2020-05-16 18:00 ` Reinette Chatre
2020-05-06 23:49 ` [PATCH V3 2/4] x86/resctrl: Enumerate per-thread MBA Reinette Chatre
2020-05-14 19:04 ` Babu Moger
2020-05-14 20:12 ` Reinette Chatre
2020-05-14 20:41 ` Babu Moger
2020-05-06 23:49 ` [PATCH V3 3/4] x86/resctrl: Enable " Reinette Chatre
2020-05-14 19:04 ` Babu Moger [this message]
2020-05-16 18:03 ` Reinette Chatre
2020-05-06 23:49 ` [PATCH V3 4/4] x86/resctrl: Use appropriate API for strings terminated by newline Reinette Chatre
2020-05-14 19:05 ` Babu Moger
2020-05-14 19:11 ` Andy Shevchenko
2020-05-14 20:06 ` Babu Moger
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=bb5b518c-2a10-1e0b-9c7d-29e58093a04a@amd.com \
--to=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=kuo-lang.tseng@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ravi.v.shankar@intel.com \
--cc=reinette.chatre@intel.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
all inboxes | Powered by JetHome®