Hi Experts,
I'm currently learning the source code of Linux kernel CFS.
I know the load balancing is based on the schedule domains(
sd) and schedule groups(
sg). However, I'm wondering, for a given core, how does the system know which
sd and
sg the core belongs to. Is there any code works for this purpose?
Also, I found that in the
kernel/sched/fair.c there is a function
sg_imbalanced:
static inline int sg_imbalanced(struct sched_group *group)
{
return group->sgc->imbalance;
}
This function could decide a group is imbalance or not. However, I can't find any function that updates the variable
sgc->imbalance so I want to know which code is responsible for updating this attribute for the groups.
Thank you in advanced.
Simon