]> asedeno.scripts.mit.edu Git - linux.git/commit
sched/fair: Calculate runnable_weight slightly differently
authorJosef Bacik <jbacik@fb.com>
Thu, 3 Aug 2017 15:13:39 +0000 (11:13 -0400)
committerIngo Molnar <mingo@kernel.org>
Fri, 29 Sep 2017 17:35:17 +0000 (19:35 +0200)
commit2c8e4dce7963d2bae02db95fce2691365630685c
tree24bfa3d440991df5e21a6dd62bf426014f959af8
parent9a2dd585b2c431ec1e5d46a9d9568291c7a534cc
sched/fair: Calculate runnable_weight slightly differently

Our runnable_weight currently looks like this

runnable_weight = shares * runnable_load_avg / load_avg

The goal is to scale the runnable weight for the group based on its runnable to
load_avg ratio.  The problem with this is it biases us towards tasks that never
go to sleep.  Tasks that go to sleep are going to have their runnable_load_avg
decayed pretty hard, which will drastically reduce the runnable weight of groups
with interactive tasks.  To solve this imbalance we tweak this slightly, so in
the ideal case it is still the above, but in the interactive case it is

runnable_weight = shares * runnable_weight / load_weight

which will make the weight distribution fairer between interactive and
non-interactive groups.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-team@fb.com
Cc: linux-kernel@vger.kernel.org
Cc: riel@redhat.com
Cc: tj@kernel.org
Link: http://lkml.kernel.org/r/1501773219-18774-2-git-send-email-jbacik@fb.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c