Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5bc59028 authored by Leo Yan's avatar Leo Yan Committed by Joonwoo Park
Browse files

sched/fair: correct task_fits_max() for misfit task



Function task_fits_max() checks if CPU maximum capacity can meet task
requirement. So it gets CPU capacity by using capacity_of(), this value
is CPU maximum capacity - bandwidth occupied by RT threads. So sometimes
capacity_of() is a bit less than CPU original capacity if the CPU has RT
threads on it. As an amendment for RT threads, function task_fits_max()
uses more flexible condition to check if the CPU can meet task
requirement, this is finished by below condition:

  if (capacity * capacity_margin > max_capacity * 1024)
		return true;

This condition introduces some unexpected result if the two clusters
have small difference so even the lower capacity cluster can easily
reach this criteria. So finally all CPUs can meet this condition and
is always invalid for misfit task checking..

This patch is to go back to use capacity_orig_of() to get CPU capacity
and if CPU is highest capacity CPU then always return true, otherwise it
will run detailed flow, this also includes the case when CPU has RT
threads on it.

Change-Id: Ice773b8bc4891887daa653e1ca26a1cb77d49630
Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
Patch-mainline: eas-dev @ 12/22/16, 15:58
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent 93a51bfa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment