Re: [PATCH v6 2/2] sched: update the rq->avg_idle when a task is moved to an idle CPU

From: Shijie Huang

Date: Thu Dec 11 2025 - 22:16:33 EST



On 12/12/2025 00:15, Dietmar Eggemann wrote:
In v2 you moved update_rq_avg_idle() (1) from activate_task() (2) to
enqueue_task() to possibly handle delayed tasks.
Not for the delayed tasks, just for a more common place to handle more cases.
In v3 you figured there can't be any delayed task on a CPU when it sets
rq->idle_stamp in sched_balance_newidle()
Yes.
So you could move (1) back to (2) avoiding the 'if rq->idle_stamp' for
the sched_change pattern for instance?
Could you please tell me what is "avoiding the 'if rq->idle_stamp' for the sched_change pattern" ?

Sorry, I do not understand your meaning.

IMHO, there is no need to move (1) back to (2).


Thanks

Huang Shijie