lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Oct 2014 09:02:18 +0200
From:	Vincent Guittot <vincent.guittot@...aro.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...nel.org>, Rik van Riel <riel@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"linaro-kernel@...ts.linaro.org" <linaro-kernel@...ts.linaro.org>
Subject: Re: [PATCH] sched: fix spurious active migration

On 30 September 2014 20:41, Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Sep 30, 2014 at 10:41:08AM +0200, Vincent Guittot wrote:
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 2a1e6ac..adad532 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -6425,13 +6425,14 @@ static struct sched_group *find_busiest_group(struct lb_env *env)
>>
>>       if (env->idle == CPU_IDLE) {
>>               /*
>> -              * This cpu is idle. If the busiest group load doesn't
>> -              * have more tasks than the number of available cpu's and
>> -              * there is no imbalance between this and busiest group
>> -              * wrt to idle cpu's, it is balanced.
>> +              * This cpu is idle. If the busiest group is not overloaded
>> +              * and there is no imbalance between this and busiest group
>> +              * wrt to idle cpus, it is balanced. The imbalance becomes
>> +              * significant if the diff is greater than 1 otherwise we
>> +              * might end up to just move the imbalance on another group
>>                */
>> -             if ((local->idle_cpus < busiest->idle_cpus) &&
>> -                 busiest->sum_nr_running <= busiest->group_weight)
>> +             if ((local->idle_cpus <= (busiest->idle_cpus + 1)) &&
>
> So I'm thick and I don't get this one.. In fact I don't seem to
> understand the existing code either.

My understand of the original code is that if a group is overloaded
(wrt capacity_factor) but has less tasks than CPUs (so overloaded
because of rt) and the local group has more idle CPUs then it's worth
balancing tasks and load.

I have changed it into : if the busiest group is overloaded or the
local has more than 1 idle CPU than the busiest, it makes sense to try
to balance tasks in order to balance the avg_load of the groups. But
if the local group has only 1 more idle CPU than the busiest, it's
probably not possible to leverage the average load load of the groups.
We will only move the imbalance from 1 group to another one

>
> If we're idle, and busiest is overloaded, we want to have tasks. Why
> would we care about number of idle cpus etc..
>
>> +                 !(busiest->group_type == group_overloaded))
>
> Would not: busiest->group_type != group_overloaded, read more natural?
> Also, would it make sense to make this the first condition?

that's fair for both remark

>
>>                       goto out_balanced;
>>       } else {
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ