Re: [PATCH v1 11/20] x86/resctrl: Calculate bandwidth from the total bytes counter

From: James Morse
Date: Fri Sep 17 2021 - 12:58:25 EST


Hi Reinette,

On 01/09/2021 22:31, Reinette Chatre wrote:
> Apologies but I find the changelog hard to understand.

No problem, clearly room for improvement!


> On 7/29/2021 3:36 PM, James Morse wrote:
>> mbm_bw_count() maintains its own copy of prev_msr to allow it to
>> calculate the bandwidth as the number of chunks counted since the
>> last time mbm_bw_count() was invoked.
>
> ok, I understand there is an extra copy

The point I was trying to get across here is mbm_bw_count() is holding a hardware value,
which means it isn't architecture agnostic. Calculating bytes first paves the way to using
an arch helper that returns bytes.

This was originally later in the series, and it looks like it got damaged during a rebase.
I've rewritten it to calculate bandwidth based on the value read by the previous
__mon_event_count(), this is simpler and less noisy for the rest of the series.



Thanks,

James