From c9af3e52ed2a4a889118df38a8637907b67816fb Mon Sep 17 00:00:00 2001 From: Cruz Zhao Date: Mon, 31 May 2021 16:50:45 +0800 Subject: [PATCH 2753/2944] Revert "alinux: sched: fix the performence regression caused by update_rq_on_expel()" This reverts commit e18ea44f213fd13793c9941ae9752ae8bbd7013b. fix #34359599 fix #34361563 fix #34362981 Commit e18ea44 introduced a risk that if NO_HZ_FULL is on, and an underclass task is the last task on rq, there is no chance to expel it. So we temporarily revert the patch before we come up with a perfect solution. Signed-off-by: Cruz Zhao Acked-by: Michael Wang --- include/linux/sched/sysctl.h | 1 - kernel/sched/fair.c | 28 +--------------------------- kernel/sched/features.h | 1 - kernel/sched/sched.h | 1 - kernel/sysctl.c | 7 ------- 5 files changed, 1 insertion(+), 37 deletions(-) diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h index d975618b..7748250 100644 --- a/include/linux/sched/sysctl.h +++ b/include/linux/sched/sysctl.h @@ -67,7 +67,6 @@ int sched_proc_update_handler(struct ctl_table *table, int write, extern unsigned int sysctl_sched_idle_saver_wmark; #ifdef CONFIG_SCHED_SMT extern int sysctl_sched_expel_idle_balance_delay; -extern unsigned long sysctl_sched_expel_update_interval; #endif #endif diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9667222..c479408 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -141,16 +141,6 @@ int __weak arch_asym_cpu_priority(int cpu) * Default: -1, units: ms */ int sysctl_sched_expel_idle_balance_delay = -1; -/* - * In order to prevent scheduling errors in the case of ipi failure, - * update_rq_on_expel() is called in function pick_next_task_fair(), - * but this will cause performence regression. In order to prevent - * errors while ensuring performence, we introduce an interval to call - * update_rq_on_expel(). - * - * Default: 10, units: ms - */ -const_debug unsigned long sysctl_sched_expel_update_interval = 10; #endif #endif @@ -681,14 +671,6 @@ static inline void update_rq_on_expel(struct rq *rq) rq->on_expel = ret; } -static inline void loose_update_rq_on_expel(struct rq *rq) -{ - if (time_after(jiffies, rq->expel_next_update) && rq->nr_under_running) { - update_rq_on_expel(rq); - rq->expel_next_update = jiffies + sysctl_sched_expel_update_interval; - } -} - static inline bool rq_on_expel(struct rq *rq) { return rq->on_expel; @@ -768,10 +750,6 @@ static inline void update_rq_on_expel(struct rq *rq) { } -static inline void loose_update_rq_on_expel(struct rq *rq) -{ -} - static inline bool rq_on_expel(struct rq *rq) { return false; @@ -7970,11 +7948,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ if (!cfs_rq->nr_running) goto idle; - if (sched_feat(ID_LOOSE_EXPEL)) - loose_update_rq_on_expel(rq); - else - update_rq_on_expel(rq); - + update_rq_on_expel(rq); if (expellee_only(rq)) { /* * In order to mark CPU as IDLE, we need to call diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 8603c81..92db87a 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -95,5 +95,4 @@ SCHED_FEAT(ID_IDLE_AVG, true) SCHED_FEAT(ID_RESCUE_EXPELLEE, true) SCHED_FEAT(ID_EXPELLEE_NEVER_HOT, false) -SCHED_FEAT(ID_LOOSE_EXPEL, true) #endif diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 97be8dd..621d433 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -873,7 +873,6 @@ struct rq { u64 avg_id_idle; #ifdef CONFIG_SCHED_SMT unsigned long next_expel_ib; - unsigned long expel_next_update; #endif #endif diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 455df53..2e00f7c 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -536,13 +536,6 @@ static int sysrq_sysctl_handler(struct ctl_table *table, int write, .mode = 0644, .proc_handler = proc_dointvec, }, - { - .procname = "sched_expel_update_interval", - .data = &sysctl_sched_expel_update_interval, - .maxlen = sizeof(unsigned long), - .mode = 0644, - .proc_handler = proc_dointvec, - }, #endif #endif #ifdef CONFIG_PROVE_LOCKING -- 1.8.3.1