On Wed, Jan 25, 2017 at 09:17:08AM -0500, Thara Gopinath wrote:
@@ -7699,8 +7734,16 @@ static inline void update_sg_lb_stats(struct lb_env *env, if (!nr_running && idle_cpu(i)) sgs->idle_cpus++;
if (cpu_overutilized(i))
if (cpu_overutilized(i)) { *overutilized = true;
/*
* If the cpu is overutilized and if there is only one
* current task in cfs runqueue, it is potentially a misfit
* task.
*/
if (rq->cfs.h_nr_running == 1)
*misfit_task = true;
}
I guess your assumption here is that if h_nr_running > 1, then group utilization compared to group capacity will set the balance flag on the parent domain?
IIUC, there may be a few corner cases that might slip through and not be balanced. For example if you have a domain with n cpus and n+1 70% utilization tasks. One cpu will have to handle two tasks and therefore be overutilized. It is likely to have h_nr_running == 2 and group utilizations will be below the threshold so we don't set the flag on the parent domain. So even if there are more cpus in the system at higher level domain, they won't bother checking if something should be pulled.
I'm not sure if the example is purely academic or it would be a real problem. I think it is hard, if not impossible, to do 'right' without going through all the tasks on the rqs which is too expensive (requires rq locking etc.).
It definitely deserves a comment somewhere :-) 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.