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

From: Nikhil Rao
Date: Fri Oct 15 2010 - 12:20:07 EST


On Fri, Oct 15, 2010 at 5:35 AM, Mike Galbraith <efault@xxxxxx> wrote:
> On Fri, 2010-10-15 at 14:20 +0200, Peter Zijlstra wrote:
>> On Fri, 2010-10-15 at 14:18 +0200, Mike Galbraith wrote:
>> > On Fri, 2010-10-15 at 14:06 +0200, Peter Zijlstra wrote:
>> > > 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?
>> >
>> > (I did that)
>> >
>> > No, just it made it look prettier to me. ÂI figured the compiler will
>> > nuke it at zero cost.
>>
>> Sure.. but it does raise the whole naming/confusion angle ;-)
>
> is_under_utilized() works for me.
>
> (as does && this && that or cpu_should_get_off_lazy_butt():)
>

Let's go with the latter for now. If that condition gets more
complicated, then we can factor it out into a different function, like
is_under_utilized().

I'll update the patch and send it out.

-Thanks
Nikhil
--
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/