lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 13/23] x86/resctrl: Allow update_mba_bw() to update controls directly
From
Date
Hi Reinette,

On 15/10/2021 23:28, Reinette Chatre wrote:
> On 10/1/2021 9:02 AM, James Morse wrote:
>> diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> index 9f45207a6c74..25baacd331e0 100644
>> --- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> +++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
>> @@ -282,6 +282,27 @@ static bool apply_config(struct rdt_hw_domain *hw_dom,
>>       return false;
>>   }
>>   +int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
>> +                u32 closid, enum resctrl_conf_type t, u32 cfg_val)
>> +{
>> +    struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
>> +    u32 idx = get_config_index(closid, t);
>> +    struct msr_param msr_param;
>> +
>> +    if (!cpumask_test_cpu(smp_processor_id(), &d->cpu_mask))
>> +        return -EINVAL;
>> +
>> +    hw_dom->ctrl_val[idx] = cfg_val;
>> +
>> +    msr_param.res = r;
>> +    msr_param.low = idx;
>> +    msr_param.high = idx + 1;
>> +
>> +    rdt_ctrl_update(&msr_param);
>> +
>
> rdt_ctrl_update() will take its parameters and recompute the domain that is already
> available here ... seems to take a few steps back and then do the needed. Could msr_update
> be called directly here instead?

Even better!


Thanks,

James

\
 
 \ /
  Last update: 2021-10-27 18:51    [W:0.500 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site