Re: [PATCH 4/4] sched: force balancing on newidle balance if localgroup has capacity

From: Peter Zijlstra
Date: Fri Oct 15 2010 - 08:06:59 EST


On Wed, 2010-10-13 at 12:09 -0700, Nikhil Rao wrote:
> +bool check_utilization(struct sd_lb_stats *sds)
> +{
> + if (!sds->this_has_capacity || sds->busiest_has_capacity)
> + return false;
> +
> + return true;
> +}
> +
> /******* find_busiest_group() helpers end here *********************/
>
> /**
> @@ -2824,6 +2845,10 @@ find_busiest_group(struct sched_domain *sd, int this_cpu,
> if (!sds.busiest || sds.busiest_nr_running == 0)
> goto out_balanced;
>
> + /* SD_BALANCE_NEWIDLE trumps SMP nice when underutilized */
> + if (idle == CPU_NEWLY_IDLE && check_utilization(&sds))
> + goto force_balance;


Is that really worth an extra function? Also the name isn't really
helpful, the comment suggests it should be called something like:
is_under_utilized().

Hmm?
--
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/