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]
Message-ID: <1cc62dbe-348e-affa-8740-c162e1454510@linux.intel.com>
Date:   Wed, 15 Jan 2020 11:33:06 -0800
From:   Tim Chen <tim.c.chen@...ux.intel.com>
To:     Aubrey Li <aubrey.li@...ux.intel.com>,
        Vineeth Remanan Pillai <vpillai@...italocean.com>
Cc:     Nishanth Aravamudan <naravamudan@...italocean.com>,
        Julien Desfossez <jdesfossez@...italocean.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Paul Turner <pjt@...gle.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
        Dario Faggioli <dfaggioli@...e.com>,
        Frédéric Weisbecker <fweisbec@...il.com>,
        Kees Cook <keescook@...omium.org>,
        Greg Kerr <kerrnel@...gle.com>, Phil Auld <pauld@...hat.com>,
        Aaron Lu <aaron.lwe@...il.com>,
        Aubrey Li <aubrey.intel@...il.com>,
        Valentin Schneider <valentin.schneider@....com>,
        Mel Gorman <mgorman@...hsingularity.net>,
        Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [RFC PATCH v4 00/19] Core scheduling v4

On 1/14/20 7:43 PM, Li, Aubrey wrote:
> On 2020/1/14 23:40, Vineeth Remanan Pillai wrote:
>> On Mon, Jan 13, 2020 at 8:12 PM Tim Chen <tim.c.chen@...ux.intel.com> wrote:
>>
>>> I also encountered kernel panic with the v4 code when taking cpu offline or online
>>> when core scheduler is running.  I've refreshed the previous patch, along
>>> with 3 other patches to fix problems related to CPU online/offline.
>>>
>>> As a side effect of the fix, each core can now operate in core-scheduling
>>> mode or non core-scheduling mode, depending on how many online SMT threads it has.
>>>
>>> Vineet, are you guys planning to refresh v4 and update it to v5?  Aubrey posted
>>> a port to the latest kernel earlier.
>>>
>> Thanks for the updated patch Tim.
>>
>> We have been testing with v4 rebased on 5.4.8 as RC kernels had given us
>> trouble in the past. v5 is due soon and we are planning to release v5 when
>> 5.5 comes out. As of now, v5 has your crash fixes and Aubrey's changes
>> related to load balancing.
> 
> It turns out my load balancing related changes need to be refined.
> For example, we don't migrate task if the task's core cookie does not match
> with CPU's core cookie, but if the entire core is idle, we should allow task
> migration, something like the following:
> 
> I plan to do this after my Chinese New Year holiday(Feb 3rd).
> 
> Thanks,
> -Aubrey
> 

Aubrey's attached patch should replace his previous patch
sched/fair: don't migrate task if cookie not match

I've also added a fix below for Aubrey's patch
sched/fair: find cookie matched idlest CPU.  

Aubrey, can you merge this fix into that patch when you update
your patches?

Tim

---->8----
>From 06c09a9c86db6a7c30e5ebca7a635005ac2df37b Mon Sep 17 00:00:00 2001
From: Tim Chen <tim.c.chen@...ux.intel.com>
Date: Thu, 12 Dec 2019 09:08:18 -0800
Subject: [PATCH] sched: Check core scheduler in use when comparing cookie

When scanning scheduler groups to find the idlest cpu for a task waking
up, cookie matching should not be considered if a target cpu doesn't
use core scheduling.  Code introduced by patch

sched/fair: find cookie matched idlest CPU

matches cookie regardless of cpu's core scheduler state.  Fix this.

Signed-off-by: Tim Chen <tim.c.chen@...ux.intel.com>
---
 kernel/sched/fair.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a90179937f63..55e7b22522db 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5656,8 +5656,15 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p,
 			for_each_cpu(i, sched_group_span(group)) {
 				struct rq *rq = cpu_rq(i);
 
-				if (p->core_cookie == rq->core->core_cookie)
+				if (!sched_core_enabled(rq)) {
 					cookie_match = true;
+					break;
+				}
+
+				if (p->core_cookie == rq->core->core_cookie) {
+					cookie_match = true;
+					break;
+				}
 			}
 			/* Skip over this group if no cookie matched */
 			if (!cookie_match)
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ