On Wed, Apr 13, 2016 at 03:56:52PM +0200, Frederic Weisbecker wrote: > Some code in cpu load update only concern NO_HZ configs but it is > built on all configurations. When NO_HZ isn't built, that code is harmless > but just happens to take some useless ressources in CPU and memory: > > 1) one useless field in struct rq > 2) jiffies record on every tick that is never used (cpu_load_update_periodic) > 3) decay_load_missed is called two times on every tick to eventually > return immediately with no action taken. And that function is dead > code. > > For pure optimization purposes, lets conditionally build the NO_HZ > related code. > > Cc: Byungchul Park <[email protected]> > Cc: Chris Metcalf <[email protected]> > Cc: Christoph Lameter <[email protected]> > Cc: Ingo Molnar <[email protected]> > Cc: Luiz Capitulino <[email protected]> > Cc: Mike Galbraith <[email protected]> > Cc: Paul E. McKenney <[email protected]> > Cc: Peter Zijlstra <[email protected]> > Cc: Rik van Riel <[email protected]> > Cc: Thomas Gleixner <[email protected]> > Signed-off-by: Frederic Weisbecker <[email protected]> > --- > kernel/sched/core.c | 3 ++- > kernel/sched/fair.c | 9 +++++++-- > kernel/sched/sched.h | 6 ++++-- > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 4c522a7..59a2821 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -7327,8 +7327,9 @@ void __init sched_init(void) > > for (j = 0; j < CPU_LOAD_IDX_MAX; j++) > rq->cpu_load[j] = 0; > - > +#ifdef CONFIG_NO_HZ_COMMON > rq->last_load_update_tick = jiffies; > +#endif
I forgot to also conditionally initialize it in sched_init(), I need to resend the patchset with that fixed.

