I think you are right, but wouldn't s/online/active above fix that as well? The active_map didnt exist at the time that code went in initially ;)

> -->> btw Why didn't we convert sched*.c to use rq->rd->online when it was> introduced ? ie Instead of using cpu_online_map directly.> I think things were converted where they made sense to convert. But we also had a different goal at that time, so perhaps something was missed. If you think something else should be converted, please point it out.

In the meantime, I would suggest we consider this patch on top of yours (applies to tip/sched/devel):

/*- * Only consider CPUs that are usable for migration.- * I guess we might want to change cpupri_find() to ignore those- * in the first place.- */- cpus_and(*lowest_mask, *lowest_mask, cpu_active_map);-- /* * At this point we have built a mask of cpus representing the * lowest priority tasks in the system. Now we want to elect * the best one based on our affinity and topology.--------------Regards,-Greg