All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] sched/fair: Migrate 'misfit' tasks on asymmetric capacity systems
@ 2018-02-15 16:20 Morten Rasmussen
  2018-02-15 16:20 ` [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations Morten Rasmussen
                   ` (7 more replies)
  0 siblings, 8 replies; 31+ messages in thread
From: Morten Rasmussen @ 2018-02-15 16:20 UTC (permalink / raw)
  To: peterz, mingo
  Cc: valentin.schneider, dietmar.eggemann, vincent.guittot,
	linux-kernel, Morten Rasmussen

On asymmetric cpu capacity systems (e.g. Arm big.LITTLE) it is crucial
for performance that cpu intensive tasks are aggressively migrated to
high capacity cpus as soon as those become available. The capacity
awareness tweaks already in the wake-up path can't handle this as such
tasks might run or be runnable forever. If they happen to be placed on a
low capacity cpu from the beginning they are stuck there forever while
high capacity cpus may have become available in the meantime.

To address this issue this patch set introduces a new "misfit"
load-balancing scenario in periodic/nohz/newly idle balance which tweaks
the load-balance conditions to ignore load per capacity in certain
cases. Since misfit tasks are commonly running alone on a cpu, more
aggressive active load-balancing is needed too.

The fundamental idea of this patch set has been in Android kernels for a
long time and is absolutely essential for consistent performance on
asymmetric cpu capacity systems.

The patches have been tested on:
   1. Arm Juno (r0): 2+4 Cortex A57/A53
   2. Hikey960: 4+4 Cortex A73/A53

Test case:
Big cpus are always kept busy. Pin a shorter running sysbench tasks to
big cpus, while creating a longer running set of unpinned sysbench
tasks.

    REQUESTS=1000
    BIGS="1 2"
    LITTLES="0 3 4 5"
 
    # Don't care about the score for those, just keep the bigs busy
    for i in $BIGS; do
        taskset -c $i sysbench --max-requests=$((REQUESTS / 4)) \
        --test=cpu  run &>/dev/null &
    done
 
    for i in $LITTLES; do
        sysbench --max-requests=$REQUESTS --test=cpu run \
	| grep "total time:" &
    done
 
    wait

Results:
Single runs with completion time of each task
Juno (tip)
    total time:                          1.2608s
    total time:                          1.2995s
    total time:                          1.5954s
    total time:                          1.7463s

Juno (misfit)
    total time:                          1.2575s
    total time:                          1.3004s
    total time:                          1.5860s
    total time:                          1.5871s

Hikey960 (tip)
    total time:                          1.7431s
    total time:                          2.2914s
    total time:                          2.5976s
    total time:                          1.7280s

Hikey960 (misfit)
    total time:                          1.7866s
    total time:                          1.7513s
    total time:                          1.6918s
    total time:                          1.6965s

10 run summary (tracking longest running task for each run)
	Juno		Hikey960
	avg	max	avg	max
tip     1.7465  1.7469  2.5997  2.6131 
misfit  1.6016  1.6192  1.8506  1.9666

Morten Rasmussen (4):
  sched: Add static_key for asymmetric cpu capacity optimizations
  sched/fair: Add group_misfit_task load-balance type
  sched/fair: Consider misfit tasks when load-balancing
  sched/fair: Avoid unnecessary balancing of asymmetric capacity groups

Valentin Schneider (3):
  sched/fair: Kick nohz balance if rq->misfit_task
  sched: Rename root_domain->overload to should_idle_balance
  sched/fair: Set sd->should_idle_balance when misfit

 kernel/sched/fair.c     | 141 +++++++++++++++++++++++++++++++++++++++++-------
 kernel/sched/sched.h    |  15 ++++--
 kernel/sched/topology.c |  10 ++++
 3 files changed, 142 insertions(+), 24 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-03-01 11:59 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15 16:20 [PATCH 0/7] sched/fair: Migrate 'misfit' tasks on asymmetric capacity systems Morten Rasmussen
2018-02-15 16:20 ` [PATCH 1/7] sched: Add static_key for asymmetric cpu capacity optimizations Morten Rasmussen
2018-02-16 13:47   ` Peter Zijlstra
2018-02-16 15:41     ` Morten Rasmussen
2018-02-16 16:51       ` Peter Zijlstra
2018-02-19 11:49         ` Morten Rasmussen
2018-02-16 17:39       ` Quentin Perret
2018-02-16 17:43         ` Peter Zijlstra
2018-02-15 16:20 ` [PATCH 2/7] sched/fair: Add group_misfit_task load-balance type Morten Rasmussen
2018-02-19 13:56   ` Peter Zijlstra
2018-02-19 13:58     ` Peter Zijlstra
2018-02-20 16:01       ` Morten Rasmussen
2018-02-15 16:20 ` [PATCH 3/7] sched/fair: Consider misfit tasks when load-balancing Morten Rasmussen
2018-02-15 16:20 ` [PATCH 4/7] sched/fair: Avoid unnecessary balancing of asymmetric capacity groups Morten Rasmussen
2018-02-19 14:50   ` Peter Zijlstra
2018-02-19 14:53     ` Peter Zijlstra
2018-02-20 16:22       ` Morten Rasmussen
2018-02-19 15:10   ` Peter Zijlstra
2018-02-20 16:33     ` Morten Rasmussen
2018-02-20 18:26       ` Peter Zijlstra
2018-02-23 16:38         ` Morten Rasmussen
2018-02-23 16:47           ` Peter Zijlstra
2018-02-26 15:06             ` Morten Rasmussen
2018-02-15 16:20 ` [PATCH 5/7] sched/fair: Kick nohz balance if rq->misfit_task Morten Rasmussen
2018-02-15 16:20 ` [PATCH 6/7] sched: Rename root_domain->overload to should_idle_balance Morten Rasmussen
2018-02-16  9:14   ` Juri Lelli
2018-02-16  9:49     ` Peter Zijlstra
2018-02-16 11:59       ` Valentin Schneider
2018-02-15 16:20 ` [PATCH 7/7] sched/fair: Set sd->should_idle_balance when misfit Morten Rasmussen
2018-02-28  7:46 ` [PATCH 0/7] sched/fair: Migrate 'misfit' tasks on asymmetric capacity systems Gaku Inami
2018-03-01 11:59   ` Valentin Schneider

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.