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]
Message-ID: <157658639132.30329.18410695427794700530.tip-bot2@tip-bot2>
Date:   Tue, 17 Dec 2019 12:39:51 -0000
From:   "tip-bot2 for Vincent Guittot" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     John Stultz <john.stultz@...aro.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Valentin Schneider <valentin.schneider@....com>,
        rostedt@...dmis.org, mingo@...hat.com, mgorman@...e.de,
        juri.lelli@...hat.com, dietmar.eggemann@....com,
        bsegall@...gle.com, qais.yousef@....com, x86 <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: [tip: sched/urgent] sched/fair: Fix find_idlest_group() to handle CPU
 affinity

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

Commit-ID:     7ed735c33104f3c6194fbc67e3a8b6e64ae84ad1
Gitweb:        https://git.kernel.org/tip/7ed735c33104f3c6194fbc67e3a8b6e64ae84ad1
Author:        Vincent Guittot <vincent.guittot@...aro.org>
AuthorDate:    Wed, 04 Dec 2019 19:21:40 +01:00
Committer:     Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 17 Dec 2019 13:32:48 +01:00

sched/fair: Fix find_idlest_group() to handle CPU affinity

Because of CPU affinity, the local group can be skipped which breaks the
assumption that statistics are always collected for local group. With
uninitialized local_sgs, the comparison is meaningless and the behavior
unpredictable. This can even end up to use local pointer which is to
NULL in this case.

If the local group has been skipped because of CPU affinity, we return
the idlest group.

Fixes: 57abff067a08 ("sched/fair: Rework find_idlest_group()")
Reported-by: John Stultz <john.stultz@...aro.org>
Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Valentin Schneider <valentin.schneider@....com>
Tested-by: John Stultz <john.stultz@...aro.org>
Cc: rostedt@...dmis.org
Cc: valentin.schneider@....com
Cc: mingo@...hat.com
Cc: mgorman@...e.de
Cc: juri.lelli@...hat.com
Cc: dietmar.eggemann@....com
Cc: bsegall@...gle.com
Cc: qais.yousef@....com
Link: https://lkml.kernel.org/r/1575483700-22153-1-git-send-email-vincent.guittot@linaro.org
---
 kernel/sched/fair.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 08a233e..146b6c8 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8417,6 +8417,10 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
 	if (!idlest)
 		return NULL;
 
+	/* The local group has been skipped because of CPU affinity */
+	if (!local)
+		return idlest;
+
 	/*
 	 * If the local group is idler than the selected idlest group
 	 * don't try and push the task.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ