Re: [tip: x86/cache] x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled

From: Borislav Petkov
Date: Wed Dec 09 2020 - 17:24:33 EST


On Wed, Dec 09, 2020 at 07:06:58PM -0000, tip-bot2 for Xiaochen Shen wrote:
> diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
> index 622073f..93a33b7 100644
> --- a/arch/x86/kernel/cpu/resctrl/monitor.c
> +++ b/arch/x86/kernel/cpu/resctrl/monitor.c
> @@ -320,7 +320,6 @@ static int __mon_event_count(u32 rmid, struct rmid_read *rr)
> }
>
> chunks = mbm_overflow_count(m->prev_msr, tval, rr->r->mbm_width);
> - m->chunks += chunks;
> m->prev_msr = tval;
>
> rr->val += get_corrected_mbm_count(rmid, m->chunks);


Hmm, zapping this one. First, there's an unused variable warning:

https://lkml.kernel.org/r/202012100516.H7sTNehL-lkp@xxxxxxxxx

and you should remove the chunks assignment too.

And then it didn't apply cleanly:

$ test-apply.sh /tmp/xiaochen.01
checking file arch/x86/kernel/cpu/resctrl/monitor.c
Hunk #1 FAILED at 279.
Hunk #2 succeeded at 514 (offset 64 lines).
1 out of 2 hunks FAILED

I wiggled it in but it ended up removing the wrong chunks inc line -
not the one in mbm_bw_count() but in __mon_event_count() - which I just
realized.

So please redo this patch against:

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/?h=x86/cache

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette