On Fri, Jul 25, 2014 at 10:02:43AM -0400, Rik van Riel wrote:
> On a related note, that part of the load balancing code probably
> needs to be rewritten to deal with unequal group_capacity_factors
> anyway.
> 
> Say that one group has a group_capacity_factor twice that of
> another group.
> 
> The group with the smaller group_capacity_factor is overloaded
> by a factor 1.3. The larger group is loaded by a factor 0.8.
> This means the larger group has a higher load than the first
> group, and the current code in update_sd_pick_busiest will
> not select the overloaded group as the busiest one, due to not
> scaling load with the capacity...
> 
> static bool update_sd_pick_busiest(struct lb_env *env,
>                                    struct sd_lb_stats *sds,
>                                    struct sched_group *sg,
>                                    struct sg_lb_stats *sgs)
> {
>         if (sgs->avg_load <= sds->busiest_stat.avg_load)
>                 return false;
> 
> I believe we may need to factor the group_capacity_factor
> into this calculation, in order to properly identify which
> group is busiest.

(sorry, going through this backwards, I'll get to the actual patch in a
bit)

Note how update_sg_lb_stats() where we compute sgs->avg_load we do
divide by sgs->group_capacity.

(also, curse this renaming of stuff)

The group_capacity_factor is something ugly and Vincent was going to
poke at that.

Attachment: pgpyHjoxqx5Kg.pgp
Description: PGP signature

Reply via email to