Re: [PATCH] i386 do_machine_check() is redundant.

Jeff Garzik
2003-09-29T19:23:17Z

On Mon, Sep 29, 2003 at 11:46:12AM -0700, Linus Torvalds wrote:
> Has anybody checked out whether the kernel works with -mregparm=3? I
> forget who did a lot of the work on it originally, and it certainly _used_
> to work fine. The improvements to both code size and performance were, if
> I remember correctly, measurable but not huge.

That jibes with what I would expect (I missed the older threads, but
was nonetheless toying with this idea myself)...

Function arguments on the stack are likely to be in L1 cache anyway,
so accessing arguments is already pretty cheap. And storing the
parameters in registers might increase the number of spills slightly,
for cases, where an argument isn't used much, or at all.

Ideally unit-at-a-time could figure out the optimal -mregparm value :)

> One worry (apart from just broken compilers and missing "asmlinkage"
> annotations) is that having compiler-version-dependent calling conventions
> makes for another variable to take into account when chasing down bugs and
> worrying about things like the Nvidia module etc. So it's probably not
> worth doing unless the advantages are clear.

Well... even with completely open source, you're never gonna have a
working system with modules built using compiler versions and options
that differ from the main kernel image. In the past, changing compiler
versions would definitely affect the module interfaces adversely.

So while I agree with your overall conservatism, worrying about
supporting miscompiled modules is the road to Hades...

Jeff