Re: [PATCH v1 11/20] x86/resctrl: Calculate bandwidth from the total bytes counter
From: Reinette Chatre
Date: Wed Sep 01 2021 - 17:31:39 EST
Hi James,
Apologies but I find the changelog hard to understand.
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 prev_msr and chunks values are in a format specific to the
architecture. MPAM's monitor scaling can be enabled for some
counters and not others. If the value is changed once the bandwidth
counter passes some threshold, the prev_msr values need to be
converted to the new scale. Having two prev_msr values is a
hindrance to moving this logic behind an architecture specific
function that returns the counters number of bytes.
Above talks about format ... it is not clear how it connects to
introduction where there was mention of an "extra copy"
Change mbm_bw_count() to calculate the total number of bytes the
counter has seen in the same way as __mon_event_count(), then
calculate the bandwidth from that. prev_bw_msr is replaced by
prev_bw_chunks, the chunks value from the last time mbm_bw_count()
was invoked.
It is not clear to me how this change connects to either the extra copy
or the format comments. It describes the changes made but it is not
clear what the problem being solved is.
It is also not clear to me what the impact of this change on the non
software controller flow is (where data is read from user space). What
is the impact now that these two flows no longer track the previous read
value separately? Would user space still see similar data as before this
change? How would the software controller sharing control of prev_msr
affect the data?
Reinette