Created attachment 94381 [details] Example application In my sytsme is an AMD Phenom II X6 1045T with 6 cores and a scaling frequency of "2700000 2000000 1400000 800000". I have noticed if a process is using ~the half of cpu time of a core I'm getting heavy performance impacts if I'm using the ondemand governor. Switching to the performance governor solves this problem. I have written a testcase in C which demonstrates this problem (compiled with "gcc -o governor governor.c -lpthread"). The application creates 20 threads (change NUM_THREADS in the code if needed) - every of them uses only a little of cpu time. All threads will be executed on the same core. Here are the differences between both governors: ondemand: The frequency of the related core goes up to 1400 MHz and the used cpu time of this core is ~50%. The application needs ~7.17 seconds to be finished. performance: The frequency of the related core is constantly 2700 MHz and the used cpu time of this core is ~25%. The application needs ~5.99 seconds to be finished. The difference between the used cpu time is logical since the frequency is as double so high. But both runs are far away from a 100% usage so theoretically they should be as same fast.
Hi, Does the problem occur on previous kernels? If possible, can you please identify from which kernel this problem starts to occur, thanks.
(In reply to comment #0) > The application creates 20 threads > (change NUM_THREADS in the code if needed) - every of them uses only a little > of cpu time. All threads will be executed on the same core. This is the reason why ondemand wouldn't give you best performance. Frequency of any core for ondemand/conservative governor increases if the load on cpu is high enough. As you have so many thread here spanning over all cpus, none of the cpus gets a high enough load to go to high frequency. Try creating a single thread or create these threads with 'taskset' for a single cpu and report back if issue persists.
Does this mean that 1400 MHz vs 2700 MHz could be slower with ondemand even if both variants are below 100% of cpu usage? If yes this means it is intended that ondemand has sometimes performance impacts and this ticket can be marked as invalid.
1400 MHz would always be slower than 2700 MHz. And ondemand can't simply switch to max without much load. So, you can say it that way "Ondemand sometimes have performance impact" :)
I thought 1400 MHz @ ~50% cpu load vs 2700 MHz @ ~25% cpu load would have mathematically ~the same performance but it doesn't seem so. What is the reason for this? Maybe because of short 100% peaks that aren't enough for an upscaling?
This one is as same as bug 55261. Not an actual bug. So mark as invalid. You can continue to discuss in the bug 55261.