[MPlayer-dev-eng] [PATCH] revert CPU speed detection

D Richard Felker III dalias at aerifal.cx
Thu Oct 7 21:08:01 CEST 2004


On Thu, Oct 07, 2004 at 08:02:50PM +0200, Aurelien Jacobs wrote:
> On Thu, 7 Oct 2004 04:34:50 +0200
> Diego Biurrun <diego at biurrun.de> wrote:
> 
> > Hi!
> > 
> > I've had a look at a way to make the CPU speed detection run only in
> > verbose mode but then reconsidered.  Speed detection has never worked
> > reliably and slows down startup noticeably.
> 
> Maybe an explaination of GetCpuSpeed reliablility. The rdtsc instruction
> is not serializing which may mean that edx:eax registers have still not
> been updated at the time the seepd is caculated ?

this seems very doubtful...

> This seems a bit silly
> to me, but the attached patch makes cpu speed detection more reliable.

hehehe @ the patch! :)
the whole reason it's being removed is that it sleeps and wastes time,
not that it's inaccurate. making it sleep longer (even if just a
little bit...and i don't trust that something else won't get scheduled
in the meantime)

anyway if you need a delay after rdtsc just do a small asm segment
that will serialize. making a function call will only make the
situation worse since eax/edx have to get pushed before the call and
restored afterwards. but i still don't believe the thing about
non-serialized meaning you can read wrong values...

> This don't mean that cpu speed detection is useful or should be kept.
> But the fact that it's not reliable is a bad argument.

your patch doesn't improve reliability. the problem is that if there's
high cpu load the rdtsc interval might not match the system timer
interval due to preemption.

rich




More information about the MPlayer-dev-eng mailing list