Re: busted CFS group load balancer?

From: Ken Chen
Date: Tue Nov 18 2008 - 12:27:28 EST


On Tue, Nov 18, 2008 at 4:30 AM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
>> I'm also very troubled with this calculation in __update_group_shares_cpu():
>>
>> shares = (sd_shares * rq_weight) / (sd_rq_weight + 1);
>>
>> Won't you have rounding problem here? value 'shares' will gradually
>> decrease for each iteration of __update_group_shares_cpu()?
>
> Yes it will, however at the top of the sched-domain tree its reset.
>
> if (!sd->parent || !(sd->parent->flags & SD_LOAD_BALANCE))
> shares = tg->shares;

Hmm? it is only true mostly on flat smp machine, or on numa system
where task is woken up across a sched-domain.

There is this code in try_to_wake_up():

for_each_domain(this_cpu, sd) {
if (cpu_isset(cpu, sd->span)) {
update_shares(sd);
break;
}
}

It doesn't iterate to the top half of the time on numa machine.

- Ken
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/