[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2bee23a-517e-4d53-af26-eb0bb5795788@arm.com>
Date: Fri, 19 Dec 2025 12:06:51 +0000
From: Ben Horgan <ben.horgan@....com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>,
James Morse <james.morse@....com>
Cc: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
D Scott Phillips OS <scott@...amperecomputing.com>,
carl@...amperecomputing.com, lcherian@...vell.com,
bobo.shaobowang@...wei.com, tan.shaopeng@...itsu.com,
baolin.wang@...ux.alibaba.com, Jamie Iles <quic_jiles@...cinc.com>,
Xin Hao <xhao@...ux.alibaba.com>, peternewman@...gle.com,
dfustini@...libre.com, amitsinght@...vell.com,
David Hildenbrand <david@...nel.org>, Dave Martin <dave.martin@....com>,
Koba Ko <kobak@...dia.com>, Shanker Donthineni <sdonthineni@...dia.com>,
fenghuay@...dia.com, baisheng.gao@...soc.com, Gavin Shan <gshan@...hat.com>,
rohit.mathew@....com, reinette.chatre@...el.com,
Punit Agrawal <punit.agrawal@....qualcomm.com>
Subject: Re: [RFC PATCH 18/38] arm_mpam: resctrl: Add support for csu counters
Hi Jonathan,
On 12/18/25 13:20, Jonathan Cameron wrote:
> On Fri, 5 Dec 2025 21:58:41 +0000
> James Morse <james.morse@....com> wrote:
>
>> resctrl exposes a counter via a file named llc_occupancy. This isn't really
>> a counter as its value goes up and down, this is a snapshot of the cache
>> storage usage monitor.
>>
>> Add some picking code to find a cache as close as possible to the L3 that
>> supports the CSU monitor.
>>
>> If there is an L3, but it doesn't have any controls, force the L3 resource
>> to exist. The existing topology_matches_l3() and
>> mpam_resctrl_domain_hdr_init() code will ensure this looks like the L3,
>> even if the class belongs to a later cache.
>>
>> Signed-off-by: James Morse <james.morse@....com>
>
> More triviality from me. I'll take a separate look at whether this actually
> works for all the systems we care about. It feels like maybe a top level
> MPAM to resctl mapping document might be useful as people are going to fall
> into traps around these various heuristics, particularly as more exciting
> topologies arrive in the future.
Seems sensible, this is one of the tricky things.
>
>
>> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
>> index fe830524639e..fc1f054f187e 100644
>> --- a/drivers/resctrl/mpam_resctrl.c
>> +++ b/drivers/resctrl/mpam_resctrl.c
>
>> /*
>> * Calculate the worst-case percentage change from each implemented step
>> * in the control.
>> @@ -499,6 +531,64 @@ static void mpam_resctrl_pick_mba(void)
>> }
>> }
>>
>> +static void counter_update_class(enum resctrl_event_id evt_id,
>> + struct mpam_class *class)
>> +{
>> + struct mpam_class *existing_class = mpam_resctrl_counters[evt_id].class;
>> +
>> + if (existing_class) {
>> + if (class->level == 3) {
>> + pr_debug("Existing class is L3 - L3 wins\n");
>> + return;
>
> As returned the else isn't adding anything much.
>
>> + } else if (existing_class->level < class->level) {
>> + pr_debug("Existing class is closer to L3, %u versus %u - closer is better\n",
>> + existing_class->level, class->level);
>> + return;
>> + }
>> + }
>> +
>> + mpam_resctrl_counters[evt_id].class = class;
>> + exposed_mon_capable = true;
>> +}
>
>
Thanks,
Ben
Powered by blists - more mailing lists