Hi Chris
We are hitting the BUG_ON below when CPUs are offlined or onlined...
On Mon, 2014-03-24 at 13:47 +0000, Chris Redpath wrote: [...]
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1929e32..681a24e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3721,30 +3721,31 @@ static inline struct hmp_domain *hmp_faster_domain(int cpu); /* must hold runqueue lock for queue se is currently on */ static struct sched_entity *hmp_get_heaviest_task(
struct sched_entity *se, int migrate_up)
struct sched_entity *se, int target_cpu)
{ int num_tasks = hmp_max_tasks; struct sched_entity *max_se = se; unsigned long int max_ratio = se->avg.load_avg_ratio; const struct cpumask *hmp_target_mask = NULL;
- struct hmp_domain *hmp;
- if (migrate_up) {
struct hmp_domain *hmp;
if (hmp_cpu_is_fastest(cpu_of(se->cfs_rq->rq)))
return max_se;
- if (hmp_cpu_is_fastest(cpu_of(se->cfs_rq->rq)))
return max_se;
hmp = hmp_faster_domain(cpu_of(se->cfs_rq->rq));
hmp_target_mask = &hmp->cpus;
- hmp = hmp_faster_domain(cpu_of(se->cfs_rq->rq));
- hmp_target_mask = &hmp->cpus;
- if (target_cpu >= 0) {
BUG_ON(!cpumask_test_cpu(target_cpu, hmp_target_mask));
This BUG_ON goes off about half the time CPU's are onlined or offlined. (See https://bugs.launchpad.net/linaro-stable-kernel/+bug/1301886)
It looks like updates to hmp_target_mask can lag or lead idle-pull attempts. I don't know if it's worth trying to investigate if there's something that can or should be done to avoid that situation occurring, or just cope with it by adding something like...
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7984458..38bc70b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3735,7 +3735,8 @@ static struct sched_entity *hmp_get_heaviest_task( hmp = hmp_faster_domain(cpu_of(se->cfs_rq->rq)); hmp_target_mask = &hmp->cpus; if (target_cpu >= 0) { - BUG_ON(!cpumask_test_cpu(target_cpu, hmp_target_mask)); + if (!cpumask_test_cpu(target_cpu, hmp_target_mask)) + return 0; hmp_target_mask = cpumask_of(target_cpu); } /* The currently running task is not on the runqueue */ @@ -7255,7 +7256,7 @@ static unsigned int hmp_idle_pull(int this_cpu) /* check if heaviest eligible task on this * CPU is heavier than previous task */ - if (hmp_task_eligible_for_up_migration(curr) && + if (curr && hmp_task_eligible_for_up_migration(curr) && curr->avg.load_avg_ratio > ratio && cpumask_test_cpu(this_cpu, tsk_cpus_allowed(task_of(curr)))) {