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:   Wed, 08 Apr 2020 12:20:25 -0000
From:   "tip-bot2 for Aubrey Li" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Vincent Guittot <vincent.guittot@...aro.org>,
        Phil Auld <pauld@...hat.com>, Mel Gorman <mgorman@...e.de>,
        Aubrey Li <aubrey.li@...ux.intel.com>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>, x86 <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/urgent] sched/fair: Fix negative imbalance in imbalance
 calculation

The following commit has been merged into the sched/urgent branch of tip:

Commit-ID:     111688ca1c4a43a7e482f5401f82c46326b8ed49
Gitweb:        https://git.kernel.org/tip/111688ca1c4a43a7e482f5401f82c46326b8ed49
Author:        Aubrey Li <aubrey.li@...el.com>
AuthorDate:    Thu, 26 Mar 2020 13:42:29 +08:00
Committer:     Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 08 Apr 2020 11:35:20 +02:00

sched/fair: Fix negative imbalance in imbalance calculation

A negative imbalance value was observed after imbalance calculation,
this happens when the local sched group type is group_fully_busy,
and the average load of local group is greater than the selected
busiest group. Fix this problem by comparing the average load of the
local and busiest group before imbalance calculation formula.

Suggested-by: Vincent Guittot <vincent.guittot@...aro.org>
Reviewed-by: Phil Auld <pauld@...hat.com>
Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>
Acked-by: Mel Gorman <mgorman@...e.de>
Signed-off-by: Aubrey Li <aubrey.li@...ux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Link: https://lkml.kernel.org/r/1585201349-70192-1-git-send-email-aubrey.li@intel.com
---
 kernel/sched/fair.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 95cbd9e..02f323b 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9036,6 +9036,14 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
 
 		sds->avg_load = (sds->total_load * SCHED_CAPACITY_SCALE) /
 				sds->total_capacity;
+		/*
+		 * If the local group is more loaded than the selected
+		 * busiest group don't try to pull any tasks.
+		 */
+		if (local->avg_load >= busiest->avg_load) {
+			env->imbalance = 0;
+			return;
+		}
 	}
 
 	/*

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ