Re: [patch] __volatile__ needed in get_cycles()?

Andrea Arcangeli (andrea@e-mind.com)
Mon, 29 Mar 1999 20:06:07 +0200 (CEST)


On Mon, 29 Mar 1999, Richard Henderson wrote:

>On Mon, Mar 29, 1999 at 01:56:40PM +0200, Andrea Arcangeli wrote:
>> About the volatile thing the reason I thought it's not needed is that we
>> care that rdtsc is run always at the same offset of code. We care only
>> about the _delta_ between the two rdtsc. So basically I seen not using
>> __volatile__ as a feature. Comments?
>
> asm("rdtsc %0" : "=A"(start));
> something;
> asm("rdtsc %0" : "=A"(stop));

I explained myself very badly. My delta could be intended as the delta you
show above.

My delta instead is the time between _two_ schedule.

schedule()
{
something
real-rdtsc
something
}

The important thing is that real-rdtsc is always run at the same offset
(and this is implicit enforced in the asm compilation).

schedule()
{
real-rdtsc
something
something
}

This order would work fine too.

schedule()
{
something
something
real-rdtsc
}

This order would be fine too.

Do you see my point now?

So there's no bug, but you are asking for a semantical change of
get_cycles().

Andrea Arcangeli

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