From 961c3a5fc3fb434e5528e4b0d4c96e65acf048b5 Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Thu, 28 May 2020 11:46:29 +0530 Subject: [PATCH] sched/walt: Improve the scheduler This change is for general scheduler improvements. Change-Id: Ica36bb6ccd4c2d8897dab62614eadb5a060d5390 Signed-off-by: Pavankumar Kondeti --- kernel/sched/core.c | 3 ++- kernel/sched/sched.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index b8dc34c5d0aa..677768a0cb44 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2489,7 +2489,8 @@ static void ttwu_queue(struct task_struct *p, int cpu, int wake_flags) struct rq_flags rf; #if defined(CONFIG_SMP) - if (sched_feat(TTWU_QUEUE) && !cpus_share_cache(smp_processor_id(), cpu)) { + if ((sched_feat(TTWU_QUEUE) && !cpus_share_cache(smp_processor_id(), cpu)) || + walt_want_remote_wakeup()) { sched_clock_cpu(cpu); /* Sync clocks across CPUs */ ttwu_queue_remote(p, cpu, wake_flags); return; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 6aed1eaae23e..f4735f549917 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -2859,6 +2859,12 @@ enum sched_boost_policy { #ifdef CONFIG_SCHED_WALT +#define WALT_MANY_WAKEUP_DEFAULT 1000 +static inline bool walt_want_remote_wakeup(void) +{ + return sysctl_sched_many_wakeup_threshold < WALT_MANY_WAKEUP_DEFAULT; +} + static inline int cluster_first_cpu(struct walt_sched_cluster *cluster) { return cpumask_first(&cluster->cpus); @@ -3268,6 +3274,10 @@ static inline bool early_detection_notify(struct rq *rq, u64 wallclock) } static inline void note_task_waking(struct task_struct *p, u64 wallclock) { } +static inline bool walt_want_remote_wakeup(void) +{ + return false; +} #endif /* CONFIG_SCHED_WALT */ struct sched_avg_stats {