From 037ebbd2e57c56f5ec9e5341a6662f92f381ba46 Mon Sep 17 00:00:00 2001 From: Wenwu Hou Date: Thu, 27 Nov 2025 12:04:13 +0800 Subject: [PATCH] anolis: sched: Exclude the load_calc thread from load average calculations. ANBZ: #27396 The load_calc kernel thread used set_current_state(TASK_UNINTERRUPTIBLE) while sleeping, causing it to be counted in load average calculations. This resulted in a constant baseline load of 1.0 even on completely idle systems. Use schedule_timeout_idle() instead to exclude the thread from load average calculations. Signed-off-by: Wenwu Hou --- kernel/sched/cpuacct.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c index 2c53b919d103..a01bd504a642 100644 --- a/kernel/sched/cpuacct.c +++ b/kernel/sched/cpuacct.c @@ -1113,9 +1113,7 @@ int load_calc_func(void *unsed) unsigned long next_update = jiffies + LOAD_FREQ; while (!kthread_should_stop()) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); - set_current_state(TASK_RUNNING); + schedule_timeout_idle(HZ/5); if (time_before(jiffies, next_update + 10)) continue; -- Gitee