RE: [PATCH next v4 0/5] minmax: Relax type checks in min() and max().

From: David Laight
Date: Wed Jan 10 2024 - 17:58:49 EST


From: Linus Torvalds
> Sent: 10 January 2024 19:35
>
> On Tue, 9 Jan 2024 at 22:17, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> >
> > > Can somebody else confirm similar time differences? Or is it just me?
> >
> > I was hopeful, but:
>
> Yeah, my build times seem to be very unstable for some reason, and
> seem to fluctuate fairly widely. I'm not sure what triggers it.
>
> The min/max simplification helps,

The first check in __types_ok() can go, the second one (with the '+ 0')
(added to promote char to int) includes the first one.

-Wsign-compare will need work from the compiler people.
I suspect that when min(unsigned_var, 4) effectively does
int four = 4;
if (unsigned_var > four)
it is going to trip the warning until gcc uses its value tracking
for that warning.

Have you looked at how much the compile-time string length
stuff costs? That might also be measurable.
And the compile-time usercopy tests.
The run-time costs of the latter can be horrid...

> but I think my "big change" thing
> was mostly due to other fluctuations.
>
> It would be lovely to have some performance automation to find build
> time regressions, although at least for me, one source of regressions
> tends to be system updates with new compilers ;(

Can we go back to gcc 2.95 or 2.97 - that would be quick on a modern cpu :-)

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)