Re: [tip:sched/urgent] sched: Fix sched-domain avg_load calculation

From: Peter Zijlstra
Date: Mon Apr 11 2011 - 07:01:12 EST


On Mon, 2011-04-11 at 10:46 +0000, tip-bot for Ken Chen wrote:
> Commit-ID: b0432d8f162c7d5d9537b4cb749d44076b76a783
> Gitweb: http://git.kernel.org/tip/b0432d8f162c7d5d9537b4cb749d44076b76a783
> Author: Ken Chen <kenchen@xxxxxxxxxx>
> AuthorDate: Thu, 7 Apr 2011 17:23:22 -0700
> Committer: Ingo Molnar <mingo@xxxxxxx>
> CommitDate: Mon, 11 Apr 2011 11:08:54 +0200
>
> sched: Fix sched-domain avg_load calculation
>
> In function find_busiest_group(), the sched-domain avg_load isn't
> calculated at all if there is a group imbalance within the domain. This
> will cause erroneous imbalance calculation.
>
> The reason is that calculate_imbalance() sees sds->avg_load = 0 and it
> will dump entire sds->max_load into imbalance variable, which is used
> later on to migrate entire load from busiest CPU to the puller CPU.
>
> This has two really bad effect:
>
> 1. stampede of task migration, and they won't be able to break out
> of the bad state because of positive feedback loop: large load
> delta -> heavier load migration -> larger imbalance and the cycle
> goes on.
>
> 2. severe imbalance in CPU queue depth. This causes really long
> scheduling latency blip which affects badly on application that
> has tight latency requirement.
>
> The fix is to have kernel calculate domain avg_load in both cases. This
> will ensure that imbalance calculation is always sensible and the target
> is usually half way between busiest and puller CPU.
>
> Signed-off-by: Ken Chen <kenchen@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Cc: <stable@xxxxxxxxxx>
> Link: http://lkml.kernel.org/r/20110408002322.3A0D812217F@xxxxxxxxxxxxxxxxxxx
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

This was caused by 866ab43ef (sched: Fix the group_imb logic) which is
only in .39-rc.
--
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/