From: Arun KS <getarunks@gmail.com>
To: Ran Shalit <ranshalit@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>,
linux-pm@vger.kernel.org,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: understanding cpuidle
Date: Tue, 21 Oct 2014 17:03:33 +0530 [thread overview]
Message-ID: <CABOM9Zpzx11gQ+ontBxY6MhrYW=AxtRdGhdybsEpp=gxwHxWLQ@mail.gmail.com> (raw)
In-Reply-To: <CAJ2oMhK_BccGQe9m1bHAc4St_jaBfaSFvyPnTRKxJwzGkfk-6Q@mail.gmail.com>
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
prev parent reply other threads:[~2014-10-21 11:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 7:42 understanding cpuidle Ran Shalit
2014-10-21 11:33 ` Arun KS [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABOM9Zpzx11gQ+ontBxY6MhrYW=AxtRdGhdybsEpp=gxwHxWLQ@mail.gmail.com' \
--to=getarunks@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ranshalit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).