* [tip: x86/urgent] x86/resctrl: Preserve CDP enable over CPU hotplug
[not found] <20200221162105.154163-1-james.morse@arm.com>
@ 2020-04-17 17:45 ` tip-bot2 for James Morse
2020-04-21 19:56 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: tip-bot2 for James Morse @ 2020-04-17 17:45 UTC (permalink / raw)
To: linux-tip-commits
Cc: Reinette Chatre, James Morse, Borislav Petkov, stable, x86, LKML
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b
Gitweb: https://git.kernel.org/tip/9fe0450785abbc04b0ed5d3cf61fcdb8ab656b4b
Author: James Morse <james.morse@arm.com>
AuthorDate: Fri, 21 Feb 2020 16:21:05
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 17 Apr 2020 19:35:01 +02:00
x86/resctrl: Preserve CDP enable over CPU hotplug
Resctrl assumes that all CPUs are online when the filesystem is mounted,
and that CPUs remember their CDP-enabled state over CPU hotplug.
This goes wrong when resctrl's CDP-enabled state changes while all the
CPUs in a domain are offline.
When a domain comes online, enable (or disable!) CDP to match resctrl's
current setting.
Fixes: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support")
Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200221162105.154163-1-james.morse@arm.com
---
arch/x86/kernel/cpu/resctrl/core.c | 2 ++
arch/x86/kernel/cpu/resctrl/internal.h | 1 +
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 13 +++++++++++++
3 files changed, 16 insertions(+)
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 89049b3..d8cc522 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -578,6 +578,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r)
d->id = id;
cpumask_set_cpu(cpu, &d->cpu_mask);
+ rdt_domain_reconfigure_cdp(r);
+
if (r->alloc_capable && domain_setup_ctrlval(r, d)) {
kfree(d);
return;
diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
index 181c992..3dd13f3 100644
--- a/arch/x86/kernel/cpu/resctrl/internal.h
+++ b/arch/x86/kernel/cpu/resctrl/internal.h
@@ -601,5 +601,6 @@ bool has_busy_rmid(struct rdt_resource *r, struct rdt_domain *d);
void __check_limbo(struct rdt_domain *d, bool force_free);
bool cbm_validate_intel(char *buf, u32 *data, struct rdt_resource *r);
bool cbm_validate_amd(char *buf, u32 *data, struct rdt_resource *r);
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
#endif /* _ASM_X86_RESCTRL_INTERNAL_H */
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 9d4e73a..5a359d9 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -1859,6 +1859,19 @@ static int set_cache_qos_cfg(int level, bool enable)
return 0;
}
+/* Restore the qos cfg state when a domain comes online */
+void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
+{
+ if (!r->alloc_capable)
+ return;
+
+ if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA])
+ l2_qos_cfg_update(&r->alloc_enabled);
+
+ if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA])
+ l3_qos_cfg_update(&r->alloc_enabled);
+}
+
/*
* Enable or disable the MBA software controller
* which helps user specify bandwidth in MBps.
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [tip: x86/urgent] x86/resctrl: Preserve CDP enable over CPU hotplug
2020-04-17 17:45 ` [tip: x86/urgent] x86/resctrl: Preserve CDP enable over CPU hotplug tip-bot2 for James Morse
@ 2020-04-21 19:56 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-04-21 19:56 UTC (permalink / raw)
To: Sasha Levin, tip-bot2 for James Morse, linux-tip-commits
Cc: Reinette Chatre, stable, stable
Hi
[This is an automated email]
This commit has been processed because it contains a "Fixes:" tag
fixing commit: 5ff193fbde20 ("x86/intel_rdt: Add basic resctrl filesystem support").
The bot has tested the following trees: v5.6.5, v5.5.18, v5.4.33, v4.19.116, v4.14.176.
v5.6.5: Build OK!
v5.5.18: Build OK!
v5.4.33: Build OK!
v4.19.116: Failed to apply! Possible dependencies:
0f00717ecce4 ("x86/resctrl: Re-arrange the RDT init code")
1ad4fa41d99f ("x86/resctrl: Initialize the vendor-specific resource functions")
4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature")
a36c5ff560fb ("x86/resctrl: Bring cbm_validate() into the resource structure")
aa50453a448a ("x86/resctrl: Move all the macros to resctrl/internal.h")
v4.14.176: Failed to apply! Possible dependencies:
0af6a48da481 ("x86/intel_rdt: Ensure RDT cleanup on exit")
0f00717ecce4 ("x86/resctrl: Re-arrange the RDT init code")
19c635ab24a1 ("x86/intel_rdt/mba_sc: Enable/disable MBA software controller")
1ad4fa41d99f ("x86/resctrl: Initialize the vendor-specific resource functions")
1bd2a63b4f0d ("x86/intel_rdt/mba_sc: Add initialization support")
2244645ab194 ("x86/intel_rdt: Fix a silent failure when writing zero value schemata")
472ef09b40c5 ("x86/intel_rdt: Associate mode with each RDT resource group")
49f7b4efa110 ("x86/intel_rdt: Enable setting of exclusive mode")
4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature")
753694a8df31 ("x86/intel_rdt: Fix data type in parsing callbacks")
7604df6e16ae ("x86/intel_rdt: Support flexible data to parsing callbacks")
8205a078ba78 ("x86/intel_rdt/mba_sc: Add schemata support")
99adde9b370d ("x86/intel_rdt: Enable L2 CDP in MSR IA32_L2_QOS_CFG")
9ab9aa15c309 ("x86/intel_rdt: Ensure requested schemata respects mode")
9af4c0a6dc1a ("x86/intel_rdt: Making CBM name and type more explicit")
aa50453a448a ("x86/resctrl: Move all the macros to resctrl/internal.h")
c377dcfbee80 ("x86/intel_rdt: Add diagnostics when writing the schemata file")
d48d7a57f718 ("x86/intel_rdt: Introduce resource group's mode resctrl file")
de73f38f7680 ("x86/intel_rdt/mba_sc: Feedback loop to dynamically update mem bandwidth")
def10853930a ("x86/intel_rdt: Add two new resources for L2 Code and Data Prioritization (CDP)")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
--
Thanks
Sasha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-21 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200221162105.154163-1-james.morse@arm.com>
2020-04-17 17:45 ` [tip: x86/urgent] x86/resctrl: Preserve CDP enable over CPU hotplug tip-bot2 for James Morse
2020-04-21 19:56 ` Sasha Levin
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).