From dca8a7b03cb561af2d32b52f0f78d0a481917f43 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Fri, 29 Apr 2022 11:23:13 -0700 Subject: [PATCH] sched/walt: prevent main walt_irq_work execution for no notif If there are no notifications pending for performing migration work, there is no migration work to be done because the work must have already been handled. Optimize the walt_irq_work execution for migrations. If no cpus got locked, then no notifications were handled, and the irq work function should exit. Change-Id: I57730503ebb8f440a288666c79c4cb4f31ed1023 Signed-off-by: Stephen Dickey --- kernel/sched/walt/walt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index a220a091d070..127bd4d8e897 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -3674,9 +3674,18 @@ static void walt_irq_work(struct irq_work *irq_work) cpumask_copy(&lock_cpus, cpu_possible_mask); - if (is_migration) + if (is_migration) { irq_work_restrict_to_mig_clusters(&lock_cpus); + /* + * if the notif_pending was handled by a previous + * walt_irq_work invocation, there is no migration + * work. + */ + if (cpumask_empty(&lock_cpus)) + return; + } + for_each_cpu(cpu, &lock_cpus) { if (level == 0) raw_spin_lock(&cpu_rq(cpu)->__lock);