linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* understanding cpuidle
@ 2014-10-16  7:42 Ran Shalit
  2014-10-21 11:33 ` Arun KS
  0 siblings, 1 reply; 2+ messages in thread
From: Ran Shalit @ 2014-10-16  7:42 UTC (permalink / raw)
  To: kernelnewbies, linux-pm, linux-omap

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: understanding cpuidle
  2014-10-16  7:42 understanding cpuidle Ran Shalit
@ 2014-10-21 11:33 ` Arun KS
  0 siblings, 0 replies; 2+ messages in thread
From: Arun KS @ 2014-10-21 11:33 UTC (permalink / raw)
  To: Ran Shalit; +Cc: kernelnewbies, linux-pm, linux-omap@vger.kernel.org

Hi Ran,

On Thu, Oct 16, 2014 at 1:12 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> 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

>
> Thanks
> Ran
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-21 11:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16  7:42 understanding cpuidle Ran Shalit
2014-10-21 11:33 ` Arun KS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).