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 {