[tip:sched/core] sched/loadavg: Generalize "_idle" naming to "_nohz"

2017-06-22 Thread tip-bot for Frederic Weisbecker
Commit-ID:  3c85d6db5e5f05ae6c3d7f5a0ceceb43746a5ca7
Gitweb: http://git.kernel.org/tip/3c85d6db5e5f05ae6c3d7f5a0ceceb43746a5ca7
Author: Frederic Weisbecker 
AuthorDate: Mon, 19 Jun 2017 04:12:00 +0200
Committer:  Ingo Molnar 
CommitDate: Thu, 22 Jun 2017 11:30:01 +0200

sched/loadavg: Generalize "_idle" naming to "_nohz"

The loadavg naming code still assumes that nohz == idle whereas its code
is actually handling well both nohz idle and nohz full.

So lets fix the naming according to what the code actually does, to
unconfuse the reader.

Signed-off-by: Frederic Weisbecker 
Acked-by: Rik van Riel 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: 
http://lkml.kernel.org/r/1497838322-10913-2-git-send-email-fweis...@gmail.com
Signed-off-by: Ingo Molnar 
---
 Documentation/trace/ftrace.txt |  2 +-
 include/linux/sched/nohz.h |  8 +++
 kernel/sched/loadavg.c | 51 +-
 kernel/time/tick-sched.c   |  4 ++--
 4 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 94a987b..fff8ff6 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -1609,7 +1609,7 @@ Doing the same with chrt -r 5 and function-trace set.
   -0   3dN.2   14us : sched_avg_update <-__cpu_load_update
   -0   3dN.2   14us : _raw_spin_unlock <-cpu_load_update_nohz
   -0   3dN.2   14us : sub_preempt_count <-_raw_spin_unlock
-  -0   3dN.1   15us : calc_load_exit_idle <-tick_nohz_idle_exit
+  -0   3dN.1   15us : calc_load_nohz_stop <-tick_nohz_idle_exit
   -0   3dN.1   15us : touch_softlockup_watchdog <-tick_nohz_idle_exit
   -0   3dN.1   15us : hrtimer_cancel <-tick_nohz_idle_exit
   -0   3dN.1   15us : hrtimer_try_to_cancel <-hrtimer_cancel
diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h
index 4995b71..7d3f75d 100644
--- a/include/linux/sched/nohz.h
+++ b/include/linux/sched/nohz.h
@@ -23,11 +23,11 @@ static inline void set_cpu_sd_state_idle(void) { }
 #endif
 
 #ifdef CONFIG_NO_HZ_COMMON
-void calc_load_enter_idle(void);
-void calc_load_exit_idle(void);
+void calc_load_nohz_start(void);
+void calc_load_nohz_stop(void);
 #else
-static inline void calc_load_enter_idle(void) { }
-static inline void calc_load_exit_idle(void) { }
+static inline void calc_load_nohz_start(void) { }
+static inline void calc_load_nohz_stop(void) { }
 #endif /* CONFIG_NO_HZ_COMMON */
 
 #if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c
index f15fb2b..f14716a 100644
--- a/kernel/sched/loadavg.c
+++ b/kernel/sched/loadavg.c
@@ -117,7 +117,7 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  * load-average relies on per-cpu sampling from the tick, it is affected by
  * NO_HZ.
  *
- * The basic idea is to fold the nr_active delta into a global idle-delta upon
+ * The basic idea is to fold the nr_active delta into a global NO_HZ-delta upon
  * entering NO_HZ state such that we can include this as an 'extra' cpu delta
  * when we read the global state.
  *
@@ -126,7 +126,7 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  *  - When we go NO_HZ idle during the window, we can negate our sample
  *contribution, causing under-accounting.
  *
- *We avoid this by keeping two idle-delta counters and flipping them
+ *We avoid this by keeping two NO_HZ-delta counters and flipping them
  *when the window starts, thus separating old and new NO_HZ load.
  *
  *The only trick is the slight shift in index flip for read vs write.
@@ -137,22 +137,22 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  *r:0 0 1   1 0   0 1   1 0
  *w:0 1 1   0 0   1 1   0 0
  *
- *This ensures we'll fold the old idle contribution in this window while
+ *This ensures we'll fold the old NO_HZ contribution in this window while
  *accumlating the new one.
  *
- *  - When we wake up from NO_HZ idle during the window, we push up our
+ *  - When we wake up from NO_HZ during the window, we push up our
  *contribution, since we effectively move our sample point to a known
  *busy state.
  *
  *This is solved by pushing the window forward, and thus skipping the
- *sample, for this cpu (effectively using the idle-delta for this cpu which
+ *sample, for this cpu (effectively using the NO_HZ-delta for this cpu 
which
  *was in effect at the time the window opened). This also solves the issue
- *of having to deal with a cpu having been in NOHZ idle for multiple
- *LOAD_FREQ intervals.
+ *of having to deal with a cpu having been in NO_HZ for multiple LOAD_FREQ
+ *  

[tip:sched/core] sched/loadavg: Generalize "_idle" naming to "_nohz"

2017-06-22 Thread tip-bot for Frederic Weisbecker
Commit-ID:  3c85d6db5e5f05ae6c3d7f5a0ceceb43746a5ca7
Gitweb: http://git.kernel.org/tip/3c85d6db5e5f05ae6c3d7f5a0ceceb43746a5ca7
Author: Frederic Weisbecker 
AuthorDate: Mon, 19 Jun 2017 04:12:00 +0200
Committer:  Ingo Molnar 
CommitDate: Thu, 22 Jun 2017 11:30:01 +0200

sched/loadavg: Generalize "_idle" naming to "_nohz"

The loadavg naming code still assumes that nohz == idle whereas its code
is actually handling well both nohz idle and nohz full.

So lets fix the naming according to what the code actually does, to
unconfuse the reader.

Signed-off-by: Frederic Weisbecker 
Acked-by: Rik van Riel 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: 
http://lkml.kernel.org/r/1497838322-10913-2-git-send-email-fweis...@gmail.com
Signed-off-by: Ingo Molnar 
---
 Documentation/trace/ftrace.txt |  2 +-
 include/linux/sched/nohz.h |  8 +++
 kernel/sched/loadavg.c | 51 +-
 kernel/time/tick-sched.c   |  4 ++--
 4 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 94a987b..fff8ff6 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -1609,7 +1609,7 @@ Doing the same with chrt -r 5 and function-trace set.
   -0   3dN.2   14us : sched_avg_update <-__cpu_load_update
   -0   3dN.2   14us : _raw_spin_unlock <-cpu_load_update_nohz
   -0   3dN.2   14us : sub_preempt_count <-_raw_spin_unlock
-  -0   3dN.1   15us : calc_load_exit_idle <-tick_nohz_idle_exit
+  -0   3dN.1   15us : calc_load_nohz_stop <-tick_nohz_idle_exit
   -0   3dN.1   15us : touch_softlockup_watchdog <-tick_nohz_idle_exit
   -0   3dN.1   15us : hrtimer_cancel <-tick_nohz_idle_exit
   -0   3dN.1   15us : hrtimer_try_to_cancel <-hrtimer_cancel
diff --git a/include/linux/sched/nohz.h b/include/linux/sched/nohz.h
index 4995b71..7d3f75d 100644
--- a/include/linux/sched/nohz.h
+++ b/include/linux/sched/nohz.h
@@ -23,11 +23,11 @@ static inline void set_cpu_sd_state_idle(void) { }
 #endif
 
 #ifdef CONFIG_NO_HZ_COMMON
-void calc_load_enter_idle(void);
-void calc_load_exit_idle(void);
+void calc_load_nohz_start(void);
+void calc_load_nohz_stop(void);
 #else
-static inline void calc_load_enter_idle(void) { }
-static inline void calc_load_exit_idle(void) { }
+static inline void calc_load_nohz_start(void) { }
+static inline void calc_load_nohz_stop(void) { }
 #endif /* CONFIG_NO_HZ_COMMON */
 
 #if defined(CONFIG_NO_HZ_COMMON) && defined(CONFIG_SMP)
diff --git a/kernel/sched/loadavg.c b/kernel/sched/loadavg.c
index f15fb2b..f14716a 100644
--- a/kernel/sched/loadavg.c
+++ b/kernel/sched/loadavg.c
@@ -117,7 +117,7 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  * load-average relies on per-cpu sampling from the tick, it is affected by
  * NO_HZ.
  *
- * The basic idea is to fold the nr_active delta into a global idle-delta upon
+ * The basic idea is to fold the nr_active delta into a global NO_HZ-delta upon
  * entering NO_HZ state such that we can include this as an 'extra' cpu delta
  * when we read the global state.
  *
@@ -126,7 +126,7 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  *  - When we go NO_HZ idle during the window, we can negate our sample
  *contribution, causing under-accounting.
  *
- *We avoid this by keeping two idle-delta counters and flipping them
+ *We avoid this by keeping two NO_HZ-delta counters and flipping them
  *when the window starts, thus separating old and new NO_HZ load.
  *
  *The only trick is the slight shift in index flip for read vs write.
@@ -137,22 +137,22 @@ calc_load(unsigned long load, unsigned long exp, unsigned 
long active)
  *r:0 0 1   1 0   0 1   1 0
  *w:0 1 1   0 0   1 1   0 0
  *
- *This ensures we'll fold the old idle contribution in this window while
+ *This ensures we'll fold the old NO_HZ contribution in this window while
  *accumlating the new one.
  *
- *  - When we wake up from NO_HZ idle during the window, we push up our
+ *  - When we wake up from NO_HZ during the window, we push up our
  *contribution, since we effectively move our sample point to a known
  *busy state.
  *
  *This is solved by pushing the window forward, and thus skipping the
- *sample, for this cpu (effectively using the idle-delta for this cpu which
+ *sample, for this cpu (effectively using the NO_HZ-delta for this cpu 
which
  *was in effect at the time the window opened). This also solves the issue
- *of having to deal with a cpu having been in NOHZ idle for multiple
- *LOAD_FREQ intervals.
+ *of having to deal with a cpu having been in NO_HZ for multiple LOAD_FREQ
+ *intervals.
  *
  * When making the ILB scale, we should try to pull this in as well.
  */
-static atomic_long_t calc_load_idle[2];
+static atomic_long_t