All of lore.kernel.org
 help / color / mirror / Atom feed
From: viresh kumar <viresh.kumar@linaro.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: tglx@linutronix.de, linaro-kernel@lists.linaro.org,
	linaro-networking@linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 14/19] tick-sched: add comment about 'idle_active' in tick_nohz_idle_exit()
Date: Tue, 22 Apr 2014 09:35:41 +0530	[thread overview]
Message-ID: <5355EA95.1060603@linaro.org> (raw)
In-Reply-To: <20140421232047.GA5579@localhost.localdomain>

On Tuesday 22 April 2014 04:50 AM, Frederic Weisbecker wrote:
> It's still over-detailed. Much of the above is easily deduced after common review. OTOH
> I proposed to summarize there: https://lkml.org/lkml/2014/4/11/334
> The below disambiguates it a bit further.

Hmm.. Something broke for sure in my repo. I do remember updating this patch with your
comments and something went wrong while playing with patches.

Sorry for that. Fixed my repo now.

> Now it's eventually getting as big as your comment ;-)
> 
> 
>           /*
>            * ts->idle_active drives the idle time which typically elapses in the idle loop
>            * but breaks on IRQs interrupting idle loop.
>            *
>            * Hence ts->idle_active can be 1 here if we exit the idle loop without the help of
>            * an IRQ. OTOH it can be 0 on idle exit if a wake up IPI pulled the CPU out of
>            * the idle loop. Since we know that we'll be exiting the idle task after the wake
>            * up IPI, all the pending idle sleep time is flushed on irq entry and no more is
>            * accounted further thanks to the need_resched() check on irq_exit().
>            */

@Thomas: Please consider this patch instead:

Author: Viresh Kumar <viresh.kumar@linaro.org>
Date:   Mon Apr 21 15:25:10 2014 +0530

    tick-sched: add comment about 'idle_active' in tick_nohz_idle_exit()

    The sequence of calls for dynticks CPUs is a bit confusing. Add a comment in
    tick_nohz_idle_exit() to mention it clearly. All information required is in
    commit and this conversation with Frederic.

    https://lkml.org/lkml/2014/4/10/355

    Suggested-by: Frederic Weisbecker <fweisbec@gmail.com>
    Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/time/tick-sched.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 71f64ee..b2f024f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -922,6 +922,17 @@ void tick_nohz_idle_exit(void)

        ts->inidle = 0;

+       /*
+        * ts->idle_active drives the idle time which typically elapses in the
+        * idle loop but breaks on IRQs interrupting idle loop.
+        *
+        * Hence ts->idle_active can be 1 here if we exit the idle loop without
+        * the help of an IRQ. OTOH it can be 0 on idle exit if a wake up IPI
+        * pulled the CPU out of the idle loop. Since we know that we'll be
+        * exiting the idle task after the wake up IPI, all the pending idle
+        * sleep time is flushed on irq entry and no more is accounted further
+        * thanks to the need_resched() check on irq_exit().
+        */
        if (ts->idle_active || ts->tick_stopped)
                now = ktime_get();



  reply	other threads:[~2014-04-22  4:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  9:54 [PATCH V2 00/19] tick: cleanups (Shouldn't change code behavior) Viresh Kumar
2014-04-21  9:54 ` [PATCH V2 01/19] tick: trivial cleanups Viresh Kumar
2014-04-22 21:23   ` Frederic Weisbecker
2014-04-23  4:49     ` Viresh Kumar
2014-04-21  9:54 ` [PATCH V2 02/19] tick: update doc style comments for 'struct tick_sched' Viresh Kumar
2014-04-21  9:54 ` [PATCH V2 03/19] tick: rearrange members of " Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 04/19] tick: move declaration of 'tick_cpu_device' to tick.h Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 05/19] tick: move definition of tick_get_device() " Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 06/19] tick: create tick_get_cpu_device() to get tick_cpu_device on this cpu Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 07/19] tick: initialize variables during their definitions Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 08/19] tick-oneshot: move tick_is_oneshot_available() to tick-oneshot.c Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 09/19] tick-oneshot: remove tick_resume_oneshot() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 10/19] tick-common: call tick_check_percpu() from tick_check_preferred() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 11/19] tick-common: remove tick_check_replacement() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 12/19] tick-common: don't pass 'cpu' & 'cpumask' to tick_setup_device() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 13/19] tick-common: remove local variable 'broadcast' from tick_resume() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 14/19] tick-sched: add comment about 'idle_active' in tick_nohz_idle_exit() Viresh Kumar
2014-04-21 23:20   ` Frederic Weisbecker
2014-04-22  4:05     ` viresh kumar [this message]
2014-04-21  9:55 ` [PATCH V2 15/19] tick-sched: define 'delta' inside 'if' block in update_ts_time_stats() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 16/19] tick-sched: remove parameters to {__}tick_nohz_task_switch() routines Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 17/19] tick-sched: remove local variable 'now' from tick_setup_sched_timer() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 18/19] tick-sched: invert parameter of tick_check_oneshot_change() Viresh Kumar
2014-04-21  9:55 ` [PATCH V2 19/19] tick-sched: rearrange code in tick_do_update_jiffies64() Viresh Kumar
2014-04-30  8:51 ` [PATCH V2 00/19] tick: cleanups (Shouldn't change code behavior) Viresh Kumar

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=5355EA95.1060603@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=fweisbec@gmail.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-networking@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.