From d71b1a76b1a797648ec6740f1a206e597d6b139a Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Tue, 21 Mar 2017 15:03:35 +0530 Subject: [PATCH] sched/core_ctl: Fix state_lock spinlock contention There is no need to call core_ctl_check() from scheduler tick path on all CPUs. This results in core_ctl's state_lock spin lock contention. Assign this job to the CPU which is responsible for updating the ticks. Change-Id: I9664037cc25c204d532bdd0f006c7e27ef143497 Signed-off-by: Pavankumar Kondeti --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 312ffdad034a..1017a3f77391 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -88,6 +88,7 @@ #include "sched.h" #include "../workqueue_internal.h" #include "../smpboot.h" +#include "../time/tick-internal.h" #define CREATE_TRACE_POINTS #include @@ -3260,7 +3261,8 @@ void scheduler_tick(void) if (curr->sched_class == &fair_sched_class) check_for_migration(rq, curr); - core_ctl_check(wallclock); + if (cpu == tick_do_timer_cpu) + core_ctl_check(wallclock); } #ifdef CONFIG_NO_HZ_FULL