From 40119a104b736bd76a7409f0b4a365994d417beb Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Wed, 10 Feb 2021 15:19:05 +0530 Subject: [PATCH] sched/walt: sched: Improve the scheduler This change is for general scheduler improvemnts. Change-Id: If28d00691bc42b62cc4fc96a49d601c7ac5e3e34 Signed-off-by: Pavankumar Kondeti --- kernel/sched/walt/core_ctl.c | 4 +--- kernel/sched/walt/cpu-boost.c | 3 +-- kernel/sched/walt/walt.c | 8 ++++++++ kernel/sched/walt/walt.h | 8 ++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/kernel/sched/walt/core_ctl.c b/kernel/sched/walt/core_ctl.c index 1413b399c98b..b4eff8b2f8c9 100644 --- a/kernel/sched/walt/core_ctl.c +++ b/kernel/sched/walt/core_ctl.c @@ -1328,7 +1328,7 @@ static int cluster_init(const struct cpumask *mask) return kobject_add(&cluster->kobj, &dev->kobj, "core_ctl"); } -static int __init core_ctl_init(void) +int core_ctl_init(void) { struct walt_sched_cluster *cluster; int ret; @@ -1350,5 +1350,3 @@ static int __init core_ctl_init(void) initialized = true; return 0; } - -late_initcall(core_ctl_init); diff --git a/kernel/sched/walt/cpu-boost.c b/kernel/sched/walt/cpu-boost.c index 006510c55f13..9b2363cf275a 100644 --- a/kernel/sched/walt/cpu-boost.c +++ b/kernel/sched/walt/cpu-boost.c @@ -330,7 +330,7 @@ static struct input_handler cpuboost_input_handler = { }; struct kobject *cpu_boost_kobj; -static int cpu_boost_init(void) +int cpu_boost_init(void) { int cpu, ret; struct cpu_sync *s; @@ -386,4 +386,3 @@ static int cpu_boost_init(void) ret = input_register_handler(&cpuboost_input_handler); return 0; } -late_initcall(cpu_boost_init); diff --git a/kernel/sched/walt/walt.c b/kernel/sched/walt/walt.c index 92a3d27b3895..c130771c3dad 100644 --- a/kernel/sched/walt/walt.c +++ b/kernel/sched/walt/walt.c @@ -2550,6 +2550,13 @@ static void walt_get_possible_siblings(int cpuid, struct cpumask *cluster_cpus) } } +static void walt_rest_init(struct work_struct *work) +{ + core_ctl_init(); + cpu_boost_init(); +} +static DECLARE_WORK(walt_work, walt_rest_init); + void walt_update_cluster_topology(void) { struct cpumask cpus = *cpu_possible_mask; @@ -2617,6 +2624,7 @@ void walt_update_cluster_topology(void) } smp_store_release(&cpu_array, tmp); walt_clusters_parsed = true; + schedule_work(&walt_work); } static int cpufreq_notifier_trans(struct notifier_block *nb, diff --git a/kernel/sched/walt/walt.h b/kernel/sched/walt/walt.h index b5985cb63f27..25f7f3492dfc 100644 --- a/kernel/sched/walt/walt.h +++ b/kernel/sched/walt/walt.h @@ -204,6 +204,14 @@ static inline unsigned int walt_nr_rtg_high_prio(int cpu) return cpu_rq(cpu)->wrq.walt_stats.nr_rtg_high_prio_tasks; } +extern int core_ctl_init(void); + +#ifdef CONFIG_CPU_FREQ +extern int cpu_boost_init(void); +#else +static inline int cpu_boost_init(void) { } +#endif + #else /* CONFIG_SCHED_WALT */ static inline void walt_sched_init_rq(struct rq *rq) { }