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 <sultan@kerneltoast.com>
fourteen
Sultan Alsawaf 4 years ago committed by Jenna
parent 58d4d01d6c
commit 746034a7a4
  1. 2
      kernel/sched/core.c

@ -2205,6 +2205,7 @@ stat:
out: out:
raw_spin_unlock_irqrestore(&p->pi_lock, flags); raw_spin_unlock_irqrestore(&p->pi_lock, flags);
#ifdef CONFIG_SCHED_WALT
if (success && sched_predl) { if (success && sched_predl) {
raw_spin_lock_irqsave(&cpu_rq(cpu)->lock, flags); raw_spin_lock_irqsave(&cpu_rq(cpu)->lock, flags);
if (do_pl_notif(cpu_rq(cpu))) if (do_pl_notif(cpu_rq(cpu)))
@ -2213,6 +2214,7 @@ out:
SCHED_CPUFREQ_PL); SCHED_CPUFREQ_PL);
raw_spin_unlock_irqrestore(&cpu_rq(cpu)->lock, flags); raw_spin_unlock_irqrestore(&cpu_rq(cpu)->lock, flags);
} }
#endif
return success; return success;
} }

Loading…
Cancel
Save