From 746034a7a484d143249dd8d04ca7d8eef8eaaf17 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 21 Mar 2021 00:06:54 -0700 Subject: [PATCH] sched/core: Skip rq lock in try_to_wake_up() when WALT is disabled When WALT is disabled, do_pl_notif() always returns false, in which case this bit of code serves no purpose. As a result, this WALT-specific code spins on acquiring the rq lock in a hot path, wasting CPU time. Compile it out when WALT is disabled to eliminate the unnecessary overhead. Change-Id: I94ec3f2ce0faad049c0bf4974b2b4442883311a4 Signed-off-by: Sultan Alsawaf --- kernel/sched/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 69804e135509..2e2780c1abe2 100755 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2205,6 +2205,7 @@ stat: out: raw_spin_unlock_irqrestore(&p->pi_lock, flags); +#ifdef CONFIG_SCHED_WALT if (success && sched_predl) { raw_spin_lock_irqsave(&cpu_rq(cpu)->lock, flags); if (do_pl_notif(cpu_rq(cpu))) @@ -2213,6 +2214,7 @@ out: SCHED_CPUFREQ_PL); raw_spin_unlock_irqrestore(&cpu_rq(cpu)->lock, flags); } +#endif return success; }