[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <88541b20-6745-28e3-6ba8-803a71554d6f@amd.com>
Date: Wed, 25 Oct 2023 18:41:49 -0500
From: "Moger, Babu" <bmoger@....com>
To: Tony Luck <tony.luck@...el.com>, "Moger, Babu" <babu.moger@....com>
Cc: Peter Newman <peternewman@...gle.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Jonathan Corbet <corbet@....net>,
Shuah Khan <skhan@...uxfoundation.org>, x86@...nel.org,
Shaopeng Tan <tan.shaopeng@...itsu.com>,
James Morse <james.morse@....com>,
Jamie Iles <quic_jiles@...cinc.com>,
Randy Dunlap <rdunlap@...radead.org>,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
patches@...ts.linux.dev
Subject: Re: [PATCH] x86/resctrl: mba_MBps: Fall back to total b/w if local
b/w unavailable
Hi Tony,
On 10/25/2023 3:52 PM, Tony Luck wrote:
> On Wed, Oct 25, 2023 at 03:42:14PM -0500, Moger, Babu wrote:
>> I meant, I was thinking bit different.
>>
>>> You need these changes in only two functions, mbm_bw_count and
>>> update_mba_bw. You decide which event you want to use based on availability,
>>>
>>> Something like this. I updated mbm_bw_count.
>>>
>>> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c
>>> b/arch/x86/kernel/cpu/resctrl/monitor.c
>>> index 0ad23475fe16..302993e4fbc3 100644
>>> --- a/arch/x86/kernel/cpu/resctrl/monitor.c
>>> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c
>>> @@ -436,8 +436,16 @@ static int __mon_event_count(u32 rmid, struct
>>> rmid_read *rr)
>>> */
>>> static void mbm_bw_count(u32 rmid, struct rmid_read *rr)
>>> {
>>> - struct mbm_state *m = &rr->d->mbm_local[rmid];
>>> u64 cur_bw, bytes, cur_bytes;
>>> + struct mbm_state *m;
>>> + int evtid;
>>> +
>>> + if (is_mbm_local_enabled())
>>> + evtid = QOS_L3_MBM_LOCAL_EVENT_ID;
>>> + else
>>> + evtid = QOS_L3_MBM_TOTAL_EVENT_ID;
>>> +
>>> + m = get_mbm_state(rr->d, rmid, evtid);
> Ok. Yes. That seems simpler.
>
> Maybe I should just set a global "mbm_evtid" at mount
Lets not make it global yet. This is only affecting couple of functions
when mba_MPps is enabled.
> time. No need to check every time to see if is_mbm_local_enabled()
> somehow changed and local b/w measurements were suddenly
> available!
What changed suddenly? Can you please elaborate.
Thanks
Babu
Powered by blists - more mailing lists