[tip: sched/core] sched/fair: Simplify balance_interval reset logic in sched_balance_rq()
From: tip-bot2 for Xin Zhao
Date: Tue Jun 30 2026 - 05:06:29 EST
The following commit has been merged into the sched/core branch of tip:
Commit-ID: f2267ad5777f36319eeb765afbf015344b24fec2
Gitweb: https://git.kernel.org/tip/f2267ad5777f36319eeb765afbf015344b24fec2
Author: Xin Zhao <jackzxcui1989@xxxxxxx>
AuthorDate: Wed, 17 Jun 2026 15:21:51 +08:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Tue, 30 Jun 2026 10:56:56 +02:00
sched/fair: Simplify balance_interval reset logic in sched_balance_rq()
Because active_balance is initialized to 0, and need_active_balance()
is a pre-condition for setting it to 1, the condition '!active_balance
|| need_active_balance()' is a truism and can be removed.
Signed-off-by: Xin Zhao <jackzxcui1989@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Link: https://patch.msgid.link/20260617072151.1173416-3-jackzxcui1989@xxxxxxx
---
kernel/sched/fair.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7d9ad78..ce836ed 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13612,10 +13612,8 @@ no_active_balance:
sd->nr_balance_failed = 0;
}
- if (likely(!active_balance) || need_active_balance(&env)) {
- /* We were unbalanced, so reset the balancing interval */
- sd->balance_interval = sd->min_interval;
- }
+ /* We were unbalanced, so reset the balancing interval */
+ sd->balance_interval = sd->min_interval;
goto out;