Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8205a07

Browse files
Vikas ShivappaKAGA-KOKO
Vikas Shivappa
authored andcommitted
x86/intel_rdt/mba_sc: Add schemata support
Currently when user updates the "schemata" with new MBA percentagevalues, kernel writes the corresponding bandwidth percentage values tothe IA32_MBA_THRTL_MSR.When MBA is expressed in MBps, the schemata format is changed to have theper package memory bandwidth in MBps instead of being specified inpercentage. Do not write the IA32_MBA_THRTL_MSRs when the schemata isupdated as that is handled separately.Signed-off-by: Vikas Shivappa <vikas.shivappa@linux.intel.com>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Cc: ravi.v.shankar@intel.comCc: tony.luck@intel.comCc: fenghua.yu@intel.comCc: vikas.shivappa@intel.comCc: ak@linux.intel.comCc: hpa@zytor.comLink:https://lkml.kernel.org/r/1524263781-14267-5-git-send-email-vikas.shivappa@linux.intel.com
1 parent1bd2a63 commit8205a07

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

‎arch/x86/kernel/cpu/intel_rdt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct rdt_resource rdt_resources_all[] = {
179179
.msr_update=mba_wrmsr,
180180
.cache_level=3,
181181
.parse_ctrlval=parse_bw,
182-
.format_str="%d=%*d",
182+
.format_str="%d=%*u",
183183
.fflags=RFTYPE_RES_MB,
184184
},
185185
};

‎arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ static bool bw_validate(char *buf, unsigned long *data, struct rdt_resource *r)
5353
return false;
5454
}
5555

56-
if (bw<r->membw.min_bw||bw>r->default_ctrl) {
56+
if ((bw<r->membw.min_bw||bw>r->default_ctrl)&&
57+
!is_mba_sc(r)) {
5758
rdt_last_cmd_printf("MB value %ld out of range [%d,%d]\n",bw,
5859
r->membw.min_bw,r->default_ctrl);
5960
return false;
@@ -179,6 +180,8 @@ static int update_domains(struct rdt_resource *r, int closid)
179180
structmsr_parammsr_param;
180181
cpumask_var_tcpu_mask;
181182
structrdt_domain*d;
183+
boolmba_sc;
184+
u32*dc;
182185
intcpu;
183186

184187
if (!zalloc_cpumask_var(&cpu_mask,GFP_KERNEL))
@@ -188,13 +191,20 @@ static int update_domains(struct rdt_resource *r, int closid)
188191
msr_param.high=msr_param.low+1;
189192
msr_param.res=r;
190193

194+
mba_sc=is_mba_sc(r);
191195
list_for_each_entry(d,&r->domains,list) {
192-
if (d->have_new_ctrl&&d->new_ctrl!=d->ctrl_val[closid]) {
196+
dc= !mba_sc ?d->ctrl_val :d->mbps_val;
197+
if (d->have_new_ctrl&&d->new_ctrl!=dc[closid]) {
193198
cpumask_set_cpu(cpumask_any(&d->cpu_mask),cpu_mask);
194-
d->ctrl_val[closid]=d->new_ctrl;
199+
dc[closid]=d->new_ctrl;
195200
}
196201
}
197-
if (cpumask_empty(cpu_mask))
202+
203+
/*
204+
* Avoid writing the control msr with control values when
205+
* MBA software controller is enabled
206+
*/
207+
if (cpumask_empty(cpu_mask)||mba_sc)
198208
gotodone;
199209
cpu=get_cpu();
200210
/* Update CBM on this cpu if it's in cpu_mask. */
@@ -282,13 +292,17 @@ static void show_doms(struct seq_file *s, struct rdt_resource *r, int closid)
282292
{
283293
structrdt_domain*dom;
284294
boolsep= false;
295+
u32ctrl_val;
285296

286297
seq_printf(s,"%*s:",max_name_width,r->name);
287298
list_for_each_entry(dom,&r->domains,list) {
288299
if (sep)
289300
seq_puts(s,";");
301+
302+
ctrl_val= (!is_mba_sc(r) ?dom->ctrl_val[closid] :
303+
dom->mbps_val[closid]);
290304
seq_printf(s,r->format_str,dom->id,max_data_width,
291-
dom->ctrl_val[closid]);
305+
ctrl_val);
292306
sep= true;
293307
}
294308
seq_puts(s,"\n");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp