forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsched-hybrid3.patch
110 lines (103 loc) · 4.79 KB
/
sched-hybrid3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: <[email protected]>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
by smtp.lore.kernel.org (Postfix) with ESMTP id DC516ECAAA3
for <[email protected]>; Thu, 25 Aug 2022 22:49:59 +0000 (UTC)
Received: ([email protected]) by vger.kernel.org via listexpand
id S244115AbiHYWt6 (ORCPT <rfc822;[email protected]>);
Thu, 25 Aug 2022 18:49:58 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38550 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S243799AbiHYWtn (ORCPT
<rfc822;[email protected]>);
Thu, 25 Aug 2022 18:49:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
d=intel.com; [email protected]; q=dns/txt; s=Intel;
t=1661467782; x=1693003782;
h=from:to:cc:subject:date:message-id:in-reply-to:
references;
bh=GkDXgCnuNRjnWESTDjDb3InPMKM7a1XvTOW385F9W9Q=;
b=RlqfFRV48+YgCLi3VvMumNkY8iTCQ+ZgMOi9qBiRWJQPbHoq8dp3elKs
cO4ZrsipTyb7Aze7C01EWhkyyKGKN3ymsclD4XTGj3yl+szdhV9MXOviP
JErGdVvnIz3bR1LEt2mWZ0ct+MJwYPz5b1uaENwlXPfBURNyErllrjI5A
ULF/1vD/z+RiReQBOQ4OcZzBVDblX5sCtn7pREX91EWlqsXeNJwomHqp8
zG0QiSdgk7wt8XFqLuvo2x8w77etQsXepcyFu5c/JN2uzY5iOm5v6rDuk
lSpik8kjAHerCkLSJzyoxuzW0N+yLTYLbU93JcT4AHh37xp0gTZIVnEUC
Q==;
X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="295153922"
X-IronPort-AV: E=Sophos;i="5.93,264,1654585200";
d="scan'208";a="295153922"
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.93,264,1654585200";
d="scan'208";a="678642681"
From: Ricardo Neri <[email protected]>
To: "Peter Zijlstra (Intel)" <[email protected]>,
Juri Lelli <[email protected]>,
Vincent Guittot <[email protected]>
Cc: Ricardo Neri <[email protected]>,
"Ravi V. Shankar" <[email protected]>,
Ben Segall <[email protected]>,
Daniel Bristot de Oliveira <[email protected]>,
Dietmar Eggemann <[email protected]>,
Len Brown <[email protected]>, Mel Gorman <[email protected]>,
"Rafael J. Wysocki" <[email protected]>,
Srinivas Pandruvada <[email protected]>,
Steven Rostedt <[email protected]>,
Tim Chen <[email protected]>,
Valentin Schneider <[email protected]>, [email protected],
Ricardo Neri <[email protected]>,
"Tim C . Chen" <[email protected]>
Subject: [PATCH 3/4] sched/fair: Let lower-priority CPUs do active balancing
Date: Thu, 25 Aug 2022 15:55:28 -0700
Message-Id: <[email protected]>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <[email protected]>
References: <[email protected]>
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: [email protected]
When more than one SMT siblings of a physical core are busy, an idle CPU
of lower priority can help.
Indicate that the low priority CPU can do active balancing from the high-
priority CPU only if they belong to separate cores.
Cc: Ben Segall <[email protected]>
Cc: Daniel Bristot de Oliveira <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Srinivas Pandruvada <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Tim C. Chen <[email protected]>
Cc: Valentin Schneider <[email protected]>
Reviewed-by: Len Brown <[email protected]>
Signed-off-by: Ricardo Neri <[email protected]>
---
kernel/sched/fair.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 810645eb58ed..9b608b31080f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9759,9 +9759,14 @@ asym_active_balance(struct lb_env *env)
* ASYM_PACKING needs to force migrate tasks from busy but
* lower priority CPUs in order to pack all tasks in the
* highest priority CPUs.
+ *
+ * If the busy CPU has higher priority but is an SMT sibling
+ * in which other SMT siblings are also busy, a lower-priority
+ * CPU in a separate core can help.
*/
return env->idle != CPU_NOT_IDLE && (env->sd->flags & SD_ASYM_PACKING) &&
- sched_asym_prefer(env->dst_cpu, env->src_cpu);
+ (sched_asym_prefer(env->dst_cpu, env->src_cpu) ||
+ !(env->sd->flags & SD_SHARE_CPUCAPACITY));
}
static inline bool
--
2.25.1