Re: get_current is __pure__, maybe __const__ even

From: Albert Cahalan
Date: Thu Sep 16 2004 - 09:20:30 EST


On Thu, 2004-09-16 at 02:58, Andi Kleen wrote:
> Albert Cahalan <albert@xxxxxxxxxxxx> writes:
>
> > Andi Kleen writes:
> >
> >> Please CSE "current" manually. It generates
> >> much better code on some architectures
> >> because the compiler cannot do it for you.
> >
> > This looks fixable.
>
> I tried it some years ago, but I ran into problems with the scheduler
> and some other code and dropped it.

Right now, I'm thinking the switch_to assembly
has bad asm constraints.

I count 8 items passed in or out of the asm.
I count 11 clobbers. You don't have 19 registers.

If you pass something in and then destroy it,
you're supposed to use a dummy output. Look at
the i386 version, where esi and edi are dummy
outputs for this reason.

I recall seeing i386 compilers complain about
clobbered inputs. I guess the x86-64 gcc needs
to have this warning added?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/