Re: [RFC PATCH RESEND 04/10] sched/fair: Add LB_PROMOTE feature to enhance real-time performance of fair tasks
From: Xin Zhao
Date: Sat Sep 12 2026 - 00:29:47 EST
On Fri, 11 Sep 2026 14:32:25 +0200 Vincent Guittot <vincent.guittot@xxxxxxxxxx> wrote:
> > Embedded platforms commonly use CONFIG_HZ_250, and testing has revealed
> > that there are numerous instances of unreasonable CPU idle events on such
> > platforms. Unreasonable CPU idle refers to situations where the CPU enters
> > an idle state for a duration of time (t), while there are tasks that can
> > run on the idle CPU and are not limited by cgroup constraints, yet these
> > tasks remain unscheduled for a duration greater than (t), t > 2.5 ms.
>
> Which looks reasonable with a 4ms tick
>
> The ILB fixes this at next tick and we have a similar version for slow
> path wake up
>
> Also you might want to look at the newly idle load balance path
I have already thoroughly reviewed the logic of ILB before working on this series
of patches. Indeed, according to the current implementation, the scheduling delays
in a 250Hz can be explained from the code perspective.
However, when it comes to using Linux for real-time systems in embedded environments,
I wonder why we can't do better in this area. As far as I know, there are an
increasing number of players Linux for real-time systems. Sacrificing 0.3% of average
system consumption in exchange for eliminating scheduling delay cases of 4ms or more,
as well as significantly reducing cases with scheduling delays between 2.5ms and ms,
should benefit everyone using Linux for real-time embedded systems. I believe it is
necessary to consider merging this feature into the mainline for embedded scenarios.
Of course, there may be better implementations. For instance, I initially thought
about replacing some of ILB logic with hrtimer, which could trigger checks earlier
and potentially yield better results. However, the existing logic in load balancing
certainly has many areas to improve real-time performance. I feel that these
improvements are not mutually exclusive; at least we enhance the real-time performance
under the scenario where the LB_PROMOTE feature is enabled.
In addition to modifying the wakeup selection logic, I have also made some changes to
the load balancing logic, as seen in the subsequent patches 7, 8, 10, particularly in
patch 10.
--
Xin Zhao