2020-01-26 20:11:11

by Valentin Schneider

[permalink] [raw]
Subject: [PATCH v3 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems

From: Morten Rasmussen <[email protected]>

SD_BALANCE_WAKE was previously added to lower sched_domain levels on
asymmetric CPU capacity systems by commit 9ee1cda5ee25 ("sched/core: Enable
SD_BALANCE_WAKE for asymmetric capacity systems") to enable the use of
find_idlest_cpu() and friends to find an appropriate CPU for tasks.

That responsibility has now been shifted to select_idle_sibling() and
friends, and hence the flag can be removed. Note that this causes
asymmetric CPU capacity systems to no longer enter the slow wakeup path
(find_idlest_cpu()) on wakeups - only on execs and forks (which is aligned
with all other mainline topologies).

Signed-off-by: Morten Rasmussen <[email protected]>
[Changelog tweaks]
Signed-off-by: Valentin Schneider <[email protected]>
---
kernel/sched/topology.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index dfb64c08a407a..00911884b7e7a 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -1374,18 +1374,9 @@ sd_init(struct sched_domain_topology_level *tl,
* Convert topological properties into behaviour.
*/

- if (sd->flags & SD_ASYM_CPUCAPACITY) {
- struct sched_domain *t = sd;
-
- /*
- * Don't attempt to spread across CPUs of different capacities.
- */
- if (sd->child)
- sd->child->flags &= ~SD_PREFER_SIBLING;
-
- for_each_lower_domain(t)
- t->flags |= SD_BALANCE_WAKE;
- }
+ /* Don't attempt to spread across CPUs of different capacities. */
+ if ((sd->flags & SD_ASYM_CPUCAPACITY) && sd->child)
+ sd->child->flags &= ~SD_PREFER_SIBLING;

if (sd->flags & SD_SHARE_CPUCAPACITY) {
sd->imbalance_pct = 110;
--
2.24.0


2020-01-29 16:28:14

by Dietmar Eggemann

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems

On 26/01/2020 21:09, Valentin Schneider wrote:
> From: Morten Rasmussen <[email protected]>

[...]

> @@ -1374,18 +1374,9 @@ sd_init(struct sched_domain_topology_level *tl,
> * Convert topological properties into behaviour.
> */
>
> - if (sd->flags & SD_ASYM_CPUCAPACITY) {
> - struct sched_domain *t = sd;
> -
> - /*
> - * Don't attempt to spread across CPUs of different capacities.
> - */
> - if (sd->child)
> - sd->child->flags &= ~SD_PREFER_SIBLING;
> -
> - for_each_lower_domain(t)

It seems that with this goes the last use of for_each_lower_domain().

[...]

2020-01-30 11:09:22

by Valentin Schneider

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] sched/topology: Remove SD_BALANCE_WAKE on asymmetric capacity systems



On 29/01/2020 16:27, Dietmar Eggemann wrote:
> On 26/01/2020 21:09, Valentin Schneider wrote:
>> From: Morten Rasmussen <[email protected]>
>
> [...]
>
>> @@ -1374,18 +1374,9 @@ sd_init(struct sched_domain_topology_level *tl,
>> * Convert topological properties into behaviour.
>> */
>>
>> - if (sd->flags & SD_ASYM_CPUCAPACITY) {
>> - struct sched_domain *t = sd;
>> -
>> - /*
>> - * Don't attempt to spread across CPUs of different capacities.
>> - */
>> - if (sd->child)
>> - sd->child->flags &= ~SD_PREFER_SIBLING;
>> -
>> - for_each_lower_domain(t)
>
> It seems that with this goes the last use of for_each_lower_domain().
>
> [...]
>

Indeed, good catch. I see that was used at some point before the
select_idle_sibling() rework:

10e2f1acd010 ("sched/core: Rewrite and improve select_idle_siblings()")

and our asymmetry policy saved it. I'll remove it in v4.