[PATCH v2 6/6 RFT] sched/fair: change sched asym checking condition

From: alexs
Date: Tue Jan 30 2024 - 08:15:31 EST


From: Alex Shi <alexs@xxxxxxxxxx>

Asym only used on SMT sd, or core sd with ITMT and core idled.
!sched_smt_active isn't necessary.

Signed-off-by: Alex Shi <alexs@xxxxxxxxxx>
To: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
To: linux-kernel@xxxxxxxxxxxxxxx
To: Valentin Schneider <vschneid@xxxxxxxxxx>
To: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
To: Ben Segall <bsegall@xxxxxxxxxx>
To: Steven Rostedt <rostedt@xxxxxxxxxxx>
To: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
To: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
To: Juri Lelli <juri.lelli@xxxxxxxxxx>
To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
To: Ingo Molnar <mingo@xxxxxxxxxx>
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6680cb39c787..0b7530b93429 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9744,8 +9744,8 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)
if (!(sd->flags & SD_ASYM_PACKING))
return false;

- return (!sched_smt_active()) ||
- (sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu);
+ return (sd->flags & SD_SHARE_CPUCAPACITY) ||
+ (is_core_idle(cpu) && test_bit(cpu_core_flags(), (void *)&sd->flags));
}

static inline bool sched_asym(struct sched_domain *sd, int dst_cpu, int src_cpu)
--
2.43.0