tags:

views:

192

answers:

2

In low latency trading applications we are very conscious of latency issues. There is some concern that our application may experience increased latency if the server on which it is running changes PowerNow state.

Any kernel developers familiar with calling PowerNow changes and how much processor time is used for the operation and what the latency/delay characteristics are like?

The same information for Intel SpeedStep would be useful but PowerNow is what we actually use.

Thanks!

+1  A: 

I doubt it has any latency. PowerNow just lowers core frequency and core voltage. I don't know that it will halt the CPU for a short time to do so and then resume processing after the change. AFAIK the change happens on the fly, the processing is not interrupted for that.

Thus the bigger problem might be that you rely on a certain speed (e.g. you assume the processor can perform that many operations a second), however when the core frequency is lowered, it will behave like a slower CPU (less operations per second) and the core frequency doesn't jump to max just because the CPU is not 100% idle. It will jump up again, when the CPU thinks it needs more processing power than it currently has.

On Linux PowerNow can cause bad issues if you run VMWare with Windows on it. Windows fails to correctly update the internal clock, as it seems to not detect that PowerNow is in effect (I guess because it runs within a virtual machine) and VMWare for Linux fails to handle the situation correctly as well. So the Windows clock will fall behind as soon as PowerNow is active and every now and then VMWare detects that and corrects the clock again. So far so well, but applications relying on the Windows clock will see this strange jump and behave rather oddly (e.g. a radio streaming software I know will jump within the MP3 stream and skip a couple of milliseconds every time the clock is resynced).

If your application depends strongly on a steady program flow, you may like to disable the PowerNow feature completely. With the Internet radio stream software, that was the only way to solve the skipping issue.

Mecki
We do not have a reliance of a specific speed being maintained, only that latency not drop below a certain amount which is no problem as we keep our boxes around 5-10% load.No VMWare in these low latency applications. This is RHEL4 on Proliant DL585 G2 straight on the hardware. Thanks!
Scott Alan Miller
+2  A: 

The Linux kernel appears to assume an upper bound of a fifth of a millisecond for a PowerNow state change operation to complete.

I would have thought a bigger worry than the cost of the state change itself, though, would be that downclocking the CPU will make your application run slower, increasing latency across the board.

moonshadow
Across the board latency is not a large concern in this case. The box is more than adequate under normal load and under heavy load. There was an irrational fear that the process of changing the state itself would introduce latency. Thanks!
Scott Alan Miller