linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sched/fair: remote load updates for idle CPUs
@ 2017-12-01 18:01 Brendan Jackman
  2017-12-01 18:01 ` [PATCH v2 1/2] sched: force update of blocked load of idle cpus Brendan Jackman
  2017-12-01 18:01 ` [PATCH v2 2/2] sched/fair: Update blocked load from newly idle balance Brendan Jackman
  0 siblings, 2 replies; 13+ messages in thread
From: Brendan Jackman @ 2017-12-01 18:01 UTC (permalink / raw)
  To: Vincent Guittot, Dietmar Eggemann, Ingo Molnar, Peter Zijlstra,
	linux-kernel

Hi,

Here is the v2, which was just delayed by my holiday.

Until a NOHZ idle balance takes place on behalf of a CPU (which may
never happen), the blocked load of of its root cfs_rq and its
contributions to task group shares are updated only by that CPU. That
means if a CPU goes suddenly from being busy to totally idle, its
load and effect on shares may not be updated for a long time.

Schedutil works around this problem by ignoring the util of CPUs
that were last updated more than a tick ago. However the stale
load does impact task placement: elements that look at load and
util (in particular the slow-path of select_task_rq_fair) can
leave the idle CPUs un-used while other CPUs go unnecessarily
overloaded. Furthermore the stale shares can impact CPU time
allotment.

Two complementary solutions are proposed here:
1. When a task wakes up, if necessary an idle CPU is woken as if to
   perform a NOHZ idle balance, which is then aborted once the load
   of NOHZ idle CPUs has been updated. This solves the problem but
   brings with it extra CPU wakeups, which have an energy cost.
2. During newly-idle load balancing, the load of remote nohz-idle
   CPUs in the sched_domain is updated. When all of the idle CPUs
   were updated in that step, the nohz.next_update field
   is pushed further into the future. This field is used to determine
   the need for triggering the newly-added NOHZ kick. So if such
   newly-idle balances are happening often enough, no additional CPU
   wakeups are required to keep all the CPUs' loads and shares
   contributions updated.

Changes v1 -> v2:

 - Vincent pointed out I broke !CONFIG_NO_HZ_COMMON, fixed that.

 - Tood Kjos pointed out that a stats kick from CPU A can inhibit a
   full balance kick from CPU B. Reduced the scope for that by having
   CPU B convert the pending/ongoing stats kick to a proper balance
   by clearing the NOHZ_STATS_KICK bit in nohz_kick_needed.

Brendan Jackman (1):
  sched/fair: Update blocked load from newly idle balance

Vincent Guittot (1):
  sched: force update of blocked load of idle cpus

 kernel/sched/core.c  |   1 +
 kernel/sched/fair.c  | 128 +++++++++++++++++++++++++++++++++++++++++++++------
 kernel/sched/sched.h |   2 +
 3 files changed, 116 insertions(+), 15 deletions(-)

--
2.14.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-12-21 10:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-01 18:01 [PATCH v2 0/2] sched/fair: remote load updates for idle CPUs Brendan Jackman
2017-12-01 18:01 ` [PATCH v2 1/2] sched: force update of blocked load of idle cpus Brendan Jackman
2017-12-20 14:03   ` Peter Zijlstra
2017-12-20 14:23     ` Vincent Guittot
2017-12-20 15:01       ` Peter Zijlstra
2017-12-20 15:05         ` Peter Zijlstra
2017-12-21  7:59         ` Vincent Guittot
2017-12-20 14:09   ` Peter Zijlstra
2017-12-20 14:27     ` Vincent Guittot
2017-12-21 10:01       ` Vincent Guittot
2017-12-01 18:01 ` [PATCH v2 2/2] sched/fair: Update blocked load from newly idle balance Brendan Jackman
2017-12-20 14:22   ` Peter Zijlstra
2017-12-21  9:19     ` Dietmar Eggemann

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).