I am experimenting with power and performance on the Jetson-TK1 using a simple video encoder as workload. When I start my encoder, it sleeps for five seconds using usleep() (http://linux.die.net/man/3/usleep), before the frame encoding starts. However, when the function returns, the frame encoding goes much slower than if I didn’t call usleep(). After a random amount of time, the time between successive frame encodings pick up again.
I attach a plot that illustrates the problem - it is very easy to see that the frame encoding is very fast if I don’t call usleep first.
- The processor frequency governor is on "performance" and it is not changing, as it can be seen in the plot.
- The high-performance cluster is always active while the encoder runs.
- I have several threads that call usleep, where this is not a problem. It is only in the main thread that this is a problem.
- The latency before the encoding speed picks up after a call to usleep() varies. Sometimes it is 2 seconds, and sometimes it is 20.
usleep_issue.pdf (21.8 KB)