Hi Leo,
On 09/08/2016 04:17 PM, Leo Yan wrote:
Function energy_aware_wake_cpu() selects CPU for task with two levels; on the first level it will firstly select schedule domain which can meet performance requirement, and on the second level it will choose CPU. When it choose CPU it will add CPU utilization and task utilization together and select one possible CPU with lowest OPP. The previous CPU of the task usually has kept historic utilization value for the task, so the previous CPU will get higher value than its real value; as result the previous CPU will be taken as the CPU which will introduce higher OPP so the task will be migrated to other CPUs. But the migration actually is not necessary and we cannot get benefit for cache hot with previous CPU.
Based on Morten's patch to calibrate previous CPU utilization for waken up task, we can get consistent utilization value for the CPU. So finally this will help to keep the task on the previous CPU.
The patch is already integrated into EAS RFCv6.
current snapshot:
git://linux-arm.org/linux-power.git eas/next/integration_20160902_1524
Look for select_energy_cpu_brute() and capacity_spare_wake().
I don't know right now why you want to integrate this one on something which bases on EASv5.2? Is it for the product code line?
We can talk about this further during tomorrows meeting.
-- Dietmar
Signed-off-by: Leo Yan leo.yan@linaro.org
kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0385723..9d8a6fd 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5985,13 +5985,14 @@ static int energy_aware_wake_cpu(struct task_struct *p, int target, int sync) for_each_cpu_and(i, tsk_cpus_allowed(p), sched_group_cpus(sg_target)) {
int cap_idx;
int cpu_wake_util = cpu_util_wake(i, p); /* * p's blocked utilization is still accounted for on prev_cpu * so prev_cpu will receive a negative bias due to the double * accounting. However, the blocked utilization may be zero. */
new_util = cpu_util(i) + task_util_boosted;
new_util = cpu_wake_util + task_util_boosted; /* * Ensure minimum capacity to grant the required boost.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.