[PATCH 0/2] sched: Remove sched_class::balance()

From: Peter Zijlstra

Date: Wed Jun 24 2026 - 08:30:37 EST


Hi!

As mentioned [1], I was going to move sched_balance_newidle() into
balance_fair(). And while the patch was quickly done, something didn't feel
right.

The two things that bugged me were:

- core-sched only calls prev_balance() on one sibling, not allowing the others
to pull tasks;

- both ::balance() and ::pick_task() take @rf and do balance operations.

That latter is because of ext; the DSQ move needs to be undone if it turns out
a higher class will get ran after all -- this is where ::pick_task() got the rf
from and why I moved its balance into pick_task_scx().

After a bit of puzzling and a few wrong turns [2], I think these patches do
away with sched_class::balance() instead, less is more and all that.

[1] https://patch.msgid.link/20260611113219.GG187714%40noisy.programming.kicks-ass.net
[2] I'm pretty sure I messed things up a few times, but rt-migration-test never
threw a failure on me -- which suggests it isn't very good at finding fails.