Re: [PATCH 1/2] x86, sched: Prevent divisions by zero in frequency invariant accounting

From: Giovanni Gherdovich
Date: Tue May 19 2020 - 12:46:51 EST


On Mon, 2020-05-18 at 15:20 -0700, Ricardo Neri wrote:
> On Sat, May 02, 2020 at 04:25:00PM +0200, Giovanni Gherdovich wrote:
> > >
> > > I've changed the patch like so.. OK?
> > >
> > > (ok, perhaps I went a little overboard with the paranoia ;-)
> >
> > Right, I wasn't really checking for overflow, only for when the product
> > "mcnt * arch_max_freq_ratio" becomes zero.
> >
> > Thanks for your edit (I took note of the macros check_*_overflow, didn't know
> > them). I fully subscribe to the paranoid approach.
> >
> > I understand you've already edited the patches in your tree, so I am not
> > resending, just confirming my
> >
> > Signed-off-by: Giovanni Gherdovich <ggherdovich@xxxxxxx>
>
> Hi, have these changes been merged? I still don't see them in the tip or
> Linus' tree.
>

Hi Ricardo,

the kbuild bot found an error in this patch, the macro check_mul_overflow
doesn't build on x86 32bit, so Peter Zijlstra hasn't merged it yet.
This is the error:
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx/thread/7GDIBOMNVDG5W2XZD4EICE2TUZR3THBN/

I'm writing a patch to avoid doing frequency invariance entirely on i386.
I doubt those machines have APERFMPERF anyways. This will fix the build error.


Cheers,
Giovanni