find_busiest_group
enum group_type {
group_other = 0,
group_misfit_task,
group_imbalanced,
group_overloaded,
};
/**
* find_busiest_group - Returns the busiest group within the sched_domain
* if there is an imbalance(不平衡).
*
* Also calculates the amount of weighted load which should be moved
* to restore(恢复) balance.
*
* @env: The load balancing environment.
*
* Return: - The busiest group if imbalance exists.
*/
static struct sched_group *find_busiest_group(struct lb_env *env)
{
struct sg_lb_stats *local, *busiest;
struct sd_lb_stats sds;
init_sd_lb_stats(&sds);
/*
* Compute the various statistics relavent for load balancing at
* this level.
*/
/* (7.3.1) 更新本层级sched_group链表中,每个sched_group的负载,
并选出busiest的一个sched_group*/
update_sd_lb_stats(env, &sds);
/* (7.3.2) 如果EAS使能,跨cluster的任务迁移使用EAS来做 */
if (energy_aware() && !sd_overutilized(