Re: [PATCH v4 1/2] sched/fair: set rq->idle_stamp at the end of the sched_balance_newidle

From: Shijie Huang

Date: Fri Nov 28 2025 - 07:54:33 EST



On 28/11/2025 18:07, Madadi Vineeth Reddy wrote:
*/
- this_rq->idle_stamp = rq_clock(this_rq);
+ idle_stamp = rq_clock(this_rq);
+
+ this_rq->idle_stamp = 0;
IIUC, by setting this_rq->idle_stamp = 0 at the beginning, any call to update_rq_avg_idle() during
load balancing when tasks are pulled will fail the if (rq->idle_stamp) check, preventing the average
idle time from being updated.

 1.) For the newidle balance, it is okay to prevent to update the rq->avg_idle.

 2.) For the idle balance, the this_rq->idle_stamp is not zero, and it can update the rq->avg_idle.

            Can the idle balance and newidle balance run at the same time?


 3.) For the busy balance, the  this_rq->idle_stamp should be zero, no need to update the rq->avg_idle.


Thanks

Huang Shijie