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

Tigran Aivazian (tigran@sco.COM)
Mon, 29 Mar 1999 07:56:06 +0100 (BST)


> On Sun, Mar 28, 1999 at 06:01:26PM +0200, Andrea Arcangeli wrote:
>> Currently when you need __volatile__ you simply don't use
>> get_cycles().
>> Maybe we could define a get_cycles_volatile() to handle that but it's a
>> minor issue.
>
> No, you want volatile on `rdtsc' all the time.
>
> r~

Andrea, I agree with Richard because it makes more sense to *never* allow
compiler move rdtsc around, neither allow anything before rdtsc to "pass"
it ("pass" in Intel's sense). As for an extra version of get_cycles() I
would vote for a von_neumann_get_cycles() (or perhaps a shorter name)
which would enforce "Von Neumann execution stream", e.g. by doing CPUID
first, but one needs to measure the combined cpuid+rdtsc overhead and
deduct it from the number of cycles in between two calls. But this would
be a very specific application of rdtsc - hence the need for a new macro.

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.aivazian.demon.co.uk

-
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/