From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Andy Lutomirski <luto@amacapital.net>,
Peter Zijlstra <peterz@infradead.org>,
umgwanakikbuti@gmail.com
Cc: mingo@kernel.org, tglx@linutronix.de, nicolas.pitre@linaro.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] sched,idle: Clarify where TIF_NRFLAG_POLLING is set
Date: Wed, 04 Jun 2014 15:03:50 +0200 [thread overview]
Message-ID: <538F1936.4000905@linaro.org> (raw)
In-Reply-To: <1f7b2a25440561e49fb6d0bace3532b5df832ffd.1401841482.git.luto@amacapital.net>
On 06/04/2014 02:29 AM, Andy Lutomirski wrote:
> This doesn't change functionality at all, but I've misread this code
> so many times that I want to make it a bit more obvious.
>
> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> ---
> kernel/sched/idle.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
> index 25b9423..2ec9f47 100644
> --- a/kernel/sched/idle.c
> +++ b/kernel/sched/idle.c
> @@ -67,6 +67,10 @@ void __weak arch_cpu_idle(void)
> * cpuidle_idle_call - the main idle function
> *
> * NOTE: no locks or semaphores should be used here
> + *
> + * On archs that support TIF_POLLING_NRFLAG, is called with polling
> + * set, and it returns with polling set. If it ever stops polling, it
> + * must clear the polling bit.
> */
> static void cpuidle_idle_call(void)
> {
> @@ -178,7 +182,14 @@ exit_idle:
> */
> static void cpu_idle_loop(void)
> {
> + __current_set_polling();
> +
> while (1) {
> + /*
> + * Invariant: polling is set here (assuming that the arch
> + * has a polling bit.
> + */
> +
nit : extra line
> tick_nohz_idle_enter();
>
> while (!need_resched()) {
> @@ -239,7 +250,6 @@ void cpu_startup_entry(enum cpuhp_state state)
> */
> boot_init_stack_canary();
> #endif
> - __current_set_polling();
I don't get the connection with the patch description.
> arch_cpu_idle_prepare();
> cpu_idle_loop();
> }
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2014-06-04 13:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 0:29 [PATCH 0/6] sched: Cleanup and improve polling idle loops Andy Lutomirski
2014-06-04 0:29 ` [PATCH 1/6] cpuidle: Set polling in poll_idle Andy Lutomirski
2014-06-04 0:29 ` [PATCH 2/6] sched,trace: Add a tracepoint for remote wakeups via polling Andy Lutomirski
2014-06-04 13:00 ` Daniel Lezcano
2014-06-04 13:54 ` Peter Zijlstra
2014-06-04 14:43 ` Andy Lutomirski
2014-06-04 0:29 ` [PATCH 3/6] sched,idle: Clarify where TIF_NRFLAG_POLLING is set Andy Lutomirski
2014-06-04 13:03 ` Daniel Lezcano [this message]
2014-06-04 14:58 ` Andy Lutomirski
2014-06-04 0:29 ` [PATCH 4/6] sched,idle: Clear polling before descheduling the idle thread Andy Lutomirski
2014-06-04 7:44 ` Peter Zijlstra
2014-06-04 14:57 ` Andy Lutomirski
2014-06-04 16:03 ` Peter Zijlstra
2014-06-04 7:53 ` Peter Zijlstra
2014-06-04 14:46 ` Andy Lutomirski
2014-06-04 0:29 ` [PATCH 5/6] sched,idle: Simplify wake_up_idle_cpu Andy Lutomirski
2014-06-04 0:29 ` [PATCH 6/6] sched: Optimize ttwu IPI Andy Lutomirski
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=538F1936.4000905@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=nicolas.pitre@linaro.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=umgwanakikbuti@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).