Re: [PATCH v21 14/18] x86/resctrl: Fill out rmid_read structure for smp_call*() to read a counter

From: Reinette Chatre
Date: Thu Jun 27 2024 - 13:53:13 EST


Hi Tony,

On 6/27/24 10:31 AM, Luck, Tony wrote:
Or do they serve as useful hints to human readers of the code?

You are of course welcome to keep those you find useful to readers of the
code. My goals with this suggestion was to (a) stop passing garbage in
struct rmid_read fields, (b) use struct rmid_read consistently.

Reinette,

I dug through the code and found only two existing redundant assignments:

rr->val = 0; (in mon_event_read())
and:
rr.first = false; (in mbm_update())

plus a third added by my patch 14:
rr.ci = NULL; (in mbm_update())

None of them seem particularly helpful hints, so I'm dropping
all three in the next rev. of the series.

Sounds good.

I think there is one more redundant assignment in mbm_update():
if (is_mbm_total_enabled()) {
...
rr.val = 0;
...
}

... but I think it may be subtle enough to keep to be consistent with
the rr.val = 0 in the following if() block that _is_ needed.

Reinette