sched/fair: Introduce fits_capacity()
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 4 Jun 2019 07:01:52 +0000 (12:31 +0530)
committerIngo Molnar <mingo@kernel.org>
Thu, 25 Jul 2019 13:51:56 +0000 (15:51 +0200)
commit60e17f5cef838e9ca7946ced208ceddcec6c315d
treea7405fc5e2f99da6e99c341c1dad46679cb008de
parente0e8d4911ed2695b12c3a01c15634000ede9bc73
sched/fair: Introduce fits_capacity()

The same formula to check utilization against capacity (after
considering capacity_margin) is already used at 5 different locations.

This patch creates a new macro, fits_capacity(), which can be used from
all these locations without exposing the details of it and hence
simplify code.

All the 5 code locations are updated as well to use it..

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
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: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lkml.kernel.org/r/b477ac75a2b163048bdaeb37f57b4c3f04f75a31.1559631700.git.viresh.kumar@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c