Re: [PATCH v5 2/2] sched/fair: Simplify balance_interval reset logic in sched_balance_rq()

From: Peter Zijlstra

Date: Thu Jun 18 2026 - 06:35:13 EST


On Thu, Jun 18, 2026 at 06:17:40PM +0800, Xin Zhao wrote:
> On Thu, 18 Jun 2026 11:40:56 +0200 Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > This is very confusing, and my AI helper isn't helping much this time
> > around.
> >
> > active_balance is initialized 0, it is only (but not always) set 1 when
> > need_active_balance().
> >
> > Therefore, the condition: !active_balance || need_active_balance() is a
> > truism and can be removed.
> >
> > Or am I missing something more complicated?
>
> Sorry for my poor English again.

No need to be; English isn't my native tongue either, although it is
much closer linguistically. It just takes a little patience (and LLM
help these days), but we'll get there.

> I will change the commit log as below:

No need, I shall edit, the patch itself looked fine.