[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180824104519.11203-14-james.morse@arm.com>
Date: Fri, 24 Aug 2018 11:45:12 +0100
From: James Morse <james.morse@....com>
To: linux-kernel@...r.kernel.org
Cc: x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Fenghua Yu <fenghua.yu@...el.com>,
Tony Luck <tony.luck@...el.com>,
Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Vikas Shivappa <vikas.shivappa@...ux.intel.com>
Subject: [RFC PATCH 13/20] x86/intel_rdt: Allow different CODE/DATA configurations to be staged
Now that the staged configuration holds its CDP type and hardware
closid, allow resctrl to stage more than configuration at a time for
a single resource.
To detect the same schema being specified twice when the schemata file
is written, the same slot in the staged_configuration array must be
used for each schema. Use the cdp_type enum directly as an index.
Signed-off-by: James Morse <james.morse@....com>
---
arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 4 ++--
include/linux/resctrl.h | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
index 05c14d9f797c..f80a838cc36d 100644
--- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
+++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c
@@ -78,7 +78,7 @@ int parse_bw(char *buf, struct rdt_resource *r, struct rdt_domain *d,
enum resctrl_conf_type t, u32 closid)
{
unsigned long data;
- struct resctrl_staged_config *cfg = &d->staged_config[0];
+ struct resctrl_staged_config *cfg = &d->staged_config[t];
if (cfg->have_new_ctrl) {
rdt_last_cmd_printf("duplicate domain %d\n", d->id);
@@ -144,7 +144,7 @@ int parse_cbm(char *buf, struct rdt_resource *r, struct rdt_domain *d,
enum resctrl_conf_type t, u32 closid)
{
unsigned long data;
- struct resctrl_staged_config *cfg = &d->staged_config[0];
+ struct resctrl_staged_config *cfg = &d->staged_config[t];
if (cfg->have_new_ctrl) {
rdt_last_cmd_printf("duplicate domain %d\n", d->id);
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index dad266f9b0fe..ede5c40756b4 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -12,6 +12,8 @@ enum resctrl_conf_type {
CDP_CODE,
CDP_DATA,
};
+#define NUM_CDP_TYPES CDP_DATA + 1
+
/**
* struct resctrl_staged_config - parsed configuration to be applied
@@ -39,7 +41,7 @@ struct rdt_domain {
int id;
struct cpumask cpu_mask;
- struct resctrl_staged_config staged_config[1];
+ struct resctrl_staged_config staged_config[NUM_CDP_TYPES];
};
/**
--
2.18.0
Powered by blists - more mailing lists