[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <65e556b6-61e1-7d84-ab8a-becaf55dbb18@huawei.com>
Date: Fri, 20 Dec 2024 17:36:23 +0800
From: Zeng Heng <zengheng4@...wei.com>
To: Dave Martin <Dave.Martin@....com>
CC: <james.morse@....com>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <jonathan.cameron@...wei.com>,
<xiexiuqi@...wei.com>, "Wangshaobo (bobo)" <bobo.shaobowang@...wei.com>
Subject: Re: [RFC PATCH mpam mpam/snapshot/v6.12-rc1 v3 4/5] arm_mpam:
Automatically synchronize the configuration of all sub-monitoring groups
On 2024/12/13 0:18, Dave Martin wrote:
> Hi,
>
>> @@ -3072,9 +3080,20 @@ struct mpam_write_config_arg {
>>
>> static int __write_config(void *arg)
>> {
>> + int closid_num = resctrl_arch_get_num_closid(NULL);
>> struct mpam_write_config_arg *c = arg;
>> + u32 reqpartid, req_idx;
>> +
>> + WARN_ON(c->partid >= closid_num);
>>
>> - mpam_reprogram_ris_partid(c->ris, c->partid, &c->comp->cfg[c->partid]);
>> + /* Synchronize the configuration to each sub-monitoring group. */
>> + for (req_idx = 0; req_idx < get_num_reqpartid_per_closid();
>> + req_idx++) {
>> + reqpartid = req_idx * closid_num + c->partid;
>> +
>> + mpam_reprogram_ris_partid(c->ris, reqpartid,
>> + &c->comp->cfg[c->partid]);
>> + }
>>
>> return 0;
>> }
>
> I haven't decided whether this iteration belongs here or in
> mpam_resctrl.c.
>
> Your approach looks like it should work; I do it in
> resctrl_arch_update_one() instead [1], but I think the approaches are
> pretty much equivalent -- but let me know if you have any thoughts on
> it.
>
Yes, the actual functions of these two locations are essentially the
same. However, at the __write_config position, we can reduce the
repeated judgments of cfg[partid] in mpam_update_config() and also
decrease the times of smp_call remote invocations.
What about your option towards it?
Best regards,
Zeng Heng
Powered by blists - more mailing lists