This is a note to let you know that I've just added the patch titled sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: sched-topology-don-t-set-sd_balance_wake-on-cpuset-d.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit f8efdf2ebec36947d92d9fe805db7cb159c82e48 Author: Valentin Schneider <vschneid@xxxxxxxxxx> Date: Mon Oct 14 17:44:08 2019 +0100 sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax [ Upstream commit 9ae7ab20b4835dbea0e5fc6a5c70171dc354a72e ] As pointed out in commit 182a85f8a119 ("sched: Disable wakeup balancing") SD_BALANCE_WAKE is a tad too aggressive, and is usually left unset. However, it turns out cpuset domain relaxation will unconditionally set it on domains below the relaxation level. This made sense back when SD_BALANCE_WAKE was set unconditionally, but it no longer is the case. We can improve things slightly by noticing that set_domain_attribute() is always called after sd_init(), so rather than setting flags we can rely on whatever sd_init() is doing and only clear certain flags when above the relaxation level. While at it, slightly clean up the function and flip the relax level check to be more human readable. Signed-off-by: Valentin Schneider <valentin.schneider@xxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Cc: mingo@xxxxxxxxxx Cc: vincent.guittot@xxxxxxxxxx Cc: juri.lelli@xxxxxxxxxx Cc: seto.hidetoshi@xxxxxxxxxxxxxx Cc: qperret@xxxxxxxxxx Cc: Dietmar.Eggemann@xxxxxxx Cc: morten.rasmussen@xxxxxxx Link: https://lkml.kernel.org/r/20191014164408.32596-1-valentin.schneider@xxxxxxx Stable-dep-of: a1fd0b9d751f ("sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 02e85cd233d42..c171783bda0cf 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -965,16 +965,13 @@ static void set_domain_attribute(struct sched_domain *sd, if (!attr || attr->relax_domain_level < 0) { if (default_relax_domain_level < 0) return; - else - request = default_relax_domain_level; + request = default_relax_domain_level; } else request = attr->relax_domain_level; - if (request < sd->level) { + + if (sd->level > request) { /* Turn off idle balance on this domain: */ sd->flags &= ~(SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); - } else { - /* Turn on idle balance on this domain: */ - sd->flags |= (SD_BALANCE_WAKE|SD_BALANCE_NEWIDLE); } }