[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250812101650.44110-1-yaozhenguo@jd.com>
Date: Tue, 12 Aug 2025 18:16:50 +0800
From: yaozhenguo <yaozhenguo1@...il.com>
To: mingo@...hat.com,
peterz@...radead.org,
vincent.guittot@...aro.org
Cc: linux-kernel@...r.kernel.org,
yaozhenguo@...com,
ZhenguoYao <yaozhenguo1@...il.com>
Subject: [PATCH] sched/fair: Introduce WAKEUP_SELECT_IDLE sched feature
From: ZhenguoYao <yaozhenguo1@...il.com>
Introduce WAKEUP_SELECT_IDLE to control if to select
CPU only has SCHED_IDLE task or idle cpu.
open it:
echo WAKEUP_SELECT_IDLE > /sys/kernel/debug/sched/features
close it:
echo NO_WAKEUP_SELECT_IDLE > /sys/kernel/debug/sched/features
In cloud computing host environments, management and monitoring software
are typically configured with SCHED_IDLE priority to avoid interference
with normal virtual machine operations. However, if vCPU wakeups
consistently select CPU cores running SCHED_IDLE tasks, critical
management and monitoring services may fail to execute—even when other
idle CPU cores are available in the system.
Our servers operate in performance power mode with idle states ( >2μs)
disabled. Consequently, selecting CPU cores running SCHED_IDLE processes
yields minimal benefits while introducing excessive latency for monitoring
and management software. Although these processes are low-priority, they
are not equivalent to offline processes.
To address this, we propose implementing a configurable switch to control
whether wakeups may target CPUs executing SCHED_IDLE tasks.
More info:https://lore.kernel.org/lkml/cover.1561523542.git.viresh.kumar@linaro.org/
Signed-off-by: ZhenguoYao <yaozhenguo1@...il.com>
---
kernel/sched/fair.c | 5 ++++-
kernel/sched/features.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b173a059315c..2d1629086307 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6781,7 +6781,10 @@ static int sched_idle_rq(struct rq *rq)
static int sched_idle_cpu(int cpu)
{
- return sched_idle_rq(cpu_rq(cpu));
+ if (sched_feat(WAKEUP_SELECT_IDLE))
+ return sched_idle_rq(cpu_rq(cpu));
+ else
+ return 0;
}
static void
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
index 3c12d9f93331..bf23a9dc6e05 100644
--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -63,6 +63,8 @@ SCHED_FEAT(DELAY_ZERO, true)
*/
SCHED_FEAT(WAKEUP_PREEMPTION, true)
+SCHED_FEAT(WAKEUP_SELECT_IDLE, true)
+
SCHED_FEAT(HRTICK, false)
SCHED_FEAT(HRTICK_DL, false)
--
2.43.5
Powered by blists - more mailing lists