在最繁忙的group中去寻找最繁忙的cpu
find_busiest_queue
/*
* find_busiest_queue - find the busiest runqueue among the cpus in group.
*/
//冒泡排序找到group内最忙的rq
static struct rq *find_busiest_queue(struct lb_env *env,
struct sched_group *group)
{
struct rq *busiest = NULL, *rq;
unsigned long busiest_load = 0, busiest_capacity = 1;
int i;
//冒泡排序遍历group内最忙的cpu
for_each_cpu_and(i, sched_group_span(group), env->cpus) {
unsigned long capacity, wl;
enum fbq_type rt;
rq = cpu_rq(i);
rt = fbq_classify_rq(rq);
/*
* We classify groups/runqueues into three groups:
* - regular: there are !numa tasks
* - remote: there are numa tasks that run on the 'wrong' node
* - all: there is no distinction
*
* In order to avoid migrating ideally placed numa tasks,
* ignore those when there's better options.
*
* If we ignore the actual busiest queue to migrate another
* task, the next balance pass can still reduce the busiest
* q

最低0.47元/天 解锁文章
504

被折叠的 条评论
为什么被折叠?



