Re: How is user space notified of CPU speed changes?

From: Andi Kleen
Date: Sat Oct 23 2004 - 18:58:22 EST


Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> writes:
> It did
>
> - The kernel doesn't always know
> - CPU speed is meaningless in hyper-threading since performance is not
> x2 for two cores but instead varies
> - It doesn't handle split CPU speed SMP - where CPU speeds vary
> - God help you if virtualised

Even without virtualization it doesn't make much sense to know the
exact CPU speed for an user process: it never knows how much CPU time
it will get (even with real time scheduling there could be even higher
priority processes)

The solution is to call gettimeofday frequently to resychronize.
It should be cheap enough that it isn't a big issue.

-Andi

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