The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 0/2] sched: update the rq->avg_idle when a task is moved to an idle CPU
@ 2025-11-28  7:54 Huang Shijie
  2025-11-28  7:54 ` [PATCH v4 1/2] sched/fair: set rq->idle_stamp at the end of the sched_balance_newidle Huang Shijie
  2025-11-28  7:54 ` [PATCH v4 2/2] sched: update the rq->avg_idle when a task is moved to an idle CPU Huang Shijie
  0 siblings, 2 replies; 8+ messages in thread
From: Huang Shijie @ 2025-11-28  7:54 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: patches, cl, Shubhang, dietmar.eggemann, rostedt, bsegall,
	mgorman, linux-kernel, vschneid, vineethr, kprateek.nayak,
	Huang Shijie

In the newidle balance, the rq->idle_stamp may set to a non-zero value
if it cannot pull any task.

In the wakeup, it will detect the rq->idle_stamp, and updates
the rq->avg_idle, then ends the CPU idle status by setting rq->idle_stamp
to zero.

Besides the wakeup, current code does not end the CPU idle status
when a task is moved to the idle CPU, such as fork/clone, execve,
or other cases.

This patch set tries to resolve it.

v3--> v4:
     Remove the code for delayed task.

   v3: https://lkml.org/lkml/2025/11/27/456

v2--> v3:
  -- merge patch 3 into patch 2:
      move update_rq_avg_idle() to enqueue_task().

   v2: https://lkml.org/lkml/2025/11/27/214   

v1--> v2:
  -- Put update_rq_avg_idle() to activate_task()
  -- Add Delay-dequeue task check.	

   v1: https://lkml.org/lkml/2025/11/24/97


Huang Shijie (2):
  sched/fair: set rq->idle_stamp at the end of the sched_balance_newidle
  sched: update the rq->avg_idle when a task is moved to an idle CPU

 kernel/sched/core.c | 29 +++++++++++++++++------------
 kernel/sched/fair.c | 12 ++++++++----
 2 files changed, 25 insertions(+), 16 deletions(-)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-12-01  2:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28  7:54 [PATCH v4 0/2] sched: update the rq->avg_idle when a task is moved to an idle CPU Huang Shijie
2025-11-28  7:54 ` [PATCH v4 1/2] sched/fair: set rq->idle_stamp at the end of the sched_balance_newidle Huang Shijie
2025-11-28  9:31   ` Peter Zijlstra
2025-12-01  2:48     ` Shijie Huang
2025-11-28 10:07   ` Madadi Vineeth Reddy
2025-11-28 12:54     ` Shijie Huang
2025-11-28 13:01       ` Shijie Huang
2025-11-28  7:54 ` [PATCH v4 2/2] sched: update the rq->avg_idle when a task is moved to an idle CPU Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox