Re: [PATCH 1/2] sched: calculate_imbalance: Fix local->avg_load >sds->avg_load case

From: Peter Zijlstra
Date: Mon Sep 16 2013 - 04:11:46 EST


On Mon, Sep 16, 2013 at 12:06:08PM +0400, Vladimir Davydov wrote:
> On 09/16/2013 09:52 AM, Peter Zijlstra wrote:
> >On Sun, Sep 15, 2013 at 05:49:13PM +0400, Vladimir Davydov wrote:

> >>- if (busiest->avg_load < sds->avg_load) {
> >>+ if (busiest->avg_load <= sds->avg_load ||
> >>+ local->avg_load >= sds->avg_load) {
> >> env->imbalance = 0;
> >> return fix_small_imbalance(env, sds);
> >> }
> >Why the = part? Surely 'busiest->avg_load < sds->avg_load ||
> >local->avg_load > sds->avg_load' avoids both underflows?
>
> Of course it does, but env->imbalance will be assigned to 0 anyway in =
> case, so why not go shortcut?

D'uh right.. hadn't had my morning juice yet.
--
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/