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] [day] [month] [year] [list]
Date:   Mon, 3 Aug 2020 20:33:58 +0800
From:   Qi Zheng <arch0.zheng@...il.com>
To:     Dietmar Eggemann <dietmar.eggemann@....com>, mingo@...hat.com,
        peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, rostedt@...dmis.org,
        bsegall@...gle.com, mgorman@...e.de
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Fix the logic about active_balance in
 load_balance()

Hi Dietmar,

I understand, thank you for your review and very detailed explanation.

Yours,
Qi Zheng

On 2020/8/3 下午3:36, Dietmar Eggemann wrote:
> On 02/08/2020 06:51, Qi Zheng wrote:
>> I think the unbalance scenario here should be that we need to
>> do active balance but it is not actually done. So fix it.
>>
>> Signed-off-by: Qi Zheng <arch0.zheng@...il.com>
>> ---
>>   kernel/sched/fair.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 2ba8f230feb9..6d8c53718b67 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -9710,7 +9710,7 @@ static int load_balance(int this_cpu, struct rq *this_rq,
>>   	} else
>>   		sd->nr_balance_failed = 0;
>>   
>> -	if (likely(!active_balance) || voluntary_active_balance(&env)) {
>> +	if (likely(!active_balance) && voluntary_active_balance(&env)) {
>>   		/* We were unbalanced, so reset the balancing interval */
>>   		sd->balance_interval = sd->min_interval;
>>   	} else {
>>
> 
> Active balance is potentially already been done when we reach this code.
> 
> See 'if (need_active_balance(&env))' and 'if (!busiest->active_balance)'
> further up.
> 
> Here we only reset sd->balance_interval in case:
> (A) the last load balance wasn't an active one
> (B) the reason for the active load balance was:
>      (1) asym packing
>      (2) capacity of src_cpu is reduced compared to the one of dst_cpu
>      (3) misfit handling
> 
> (B) is done to not unnecessarily increase of balance interval, see
> commit 46a745d90585 ("sched/fair: Fix unnecessary increase of balance
> interval").
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ