Discussion:
understanding cpuidle
Ran Shalit
2014-10-16 07:42:09 UTC
Permalink
Hello,

I try to understand the cpuidle main concept but have some
difficulties. I could not find any documentation to explain the
cpuidle.

what does it mean that it enters idle when "no thread to run" ?if I
have only one process which does only
while(1)
{
printf("C");
mdelay(1000);
}
Can I expect it to enter idle for 1 second and then print "C" and get
again to idle ?

Thanks
Ran
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Arun KS
2014-10-21 11:33:33 UTC
Permalink
Hi Ran,
Post by Ran Shalit
Hello,
I try to understand the cpuidle main concept but have some
difficulties. I could not find any documentation to explain the
cpuidle.
what does it mean that it enters idle when "no thread to run" ?if I
have only one process which does only
while(1)
{
printf("C");
mdelay(1000);
}
Can I expect it to enter idle for 1 second and then print "C" and get
again to idle ?
Your code will not go to cpu idle, because it is mdelay(), which is a
busy looping.

If you have used msleep(), you are relinquishing the cpu.
Considering the fact that you have only one process running in your
system, no other process in runnable state, kernel schedules the
swapper(or idle) process.
And you will enter into cpu idle.

Thanks,
Arun
Post by Ran Shalit
Thanks
Ran
_______________________________________________
Kernelnewbies mailing list
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...