From: Chris Redpath Date: Mon, 19 Aug 2013 14:06:23 +0000 (+0100) Subject: HMP: Update migration timer when we fork-migrate X-Git-Tag: firefly_0821_release~3680^2~5^2~3^2~18^2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=18e3c3d2cc1346cb7cc2e3fd777b2c6f4fbb6135;p=firefly-linux-kernel-4.4.55.git HMP: Update migration timer when we fork-migrate Prevents fork-migration adversely interacting with normal migration (i.e. runqueues containing forked tasks being selected as migration targets when there is a better choice available) Signed-off-by: Chris Redpath Signed-off-by: Liviu Dudau Signed-off-by: Jon Medhurst --- diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bfd27e89399a..754634e774ad 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4079,18 +4079,26 @@ select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flags) if(hmp_cpu_is_fastest(prev_cpu)) { struct hmp_domain *hmpdom = list_entry(&hmp_cpu_domain(prev_cpu)->hmp_domains, struct hmp_domain, hmp_domains); __always_unused int lowest_ratio = hmp_domain_min_load(hmpdom, &new_cpu); - if(new_cpu != NR_CPUS && cpumask_test_cpu(new_cpu,tsk_cpus_allowed(p))) + if (new_cpu != NR_CPUS && + cpumask_test_cpu(new_cpu, + tsk_cpus_allowed(p))) { + hmp_next_up_delay(&p->se, new_cpu); return new_cpu; - else { - new_cpu = cpumask_any_and(&hmp_faster_domain(cpu)->cpus, + } else { + new_cpu = cpumask_any_and( + &hmp_faster_domain(cpu)->cpus, tsk_cpus_allowed(p)); - if(new_cpu < nr_cpu_ids) + if (new_cpu < nr_cpu_ids) { + hmp_next_up_delay(&p->se, new_cpu); return new_cpu; + } } } else { new_cpu = hmp_select_faster_cpu(p, prev_cpu); - if (new_cpu != NR_CPUS) + if (new_cpu != NR_CPUS) { + hmp_next_up_delay(&p->se, new_cpu); return new_cpu; + } } } #endif