[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXLWCfwbOPc83dvX@SH-HV00110.Hygon.cn>
Date: Fri, 23 Jan 2026 09:59:37 +0800
From: Huang Shijie <shijie8@...il.com>
To: Shubhang Kaushik <shubhang@...amperecomputing.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Shubhang Kaushik <sh@...two.org>,
Valentin Schneider <vschneid@...hat.com>,
K Prateek Nayak <kprateek.nayak@....com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8] sched: update rq->avg_idle when a task is moved to an
idle CPU
On Wed, Jan 21, 2026 at 01:31:53AM -0800, Shubhang Kaushik wrote:
> Currently, rq->idle_stamp is only used to calculate avg_idle during
> wakeups. This means other paths that move a task to an idle CPU such as
> fork/clone, execve, or migrations, do not end the CPU's idle status in
> the scheduler's eyes, leading to an inaccurate avg_idle.
>
> This patch introduces update_rq_avg_idle() to provide a more accurate
> measurement of CPU idle duration. By invoking this helper in
> put_prev_task_idle(), we ensure avg_idle is updated whenever a CPU
> stops being idle, regardless of how the new task arrived.
>
> Changes in v8:
> - Removed the 'if (rq->idle_stamp)' check: Based on reviewer feedback,
> tracking any idle duration (not just fair-class specific) provides a
> more universal view of core availability.
>
> Testing on an 80-core Ampere Altra (ARMv8) with 6.19-rc5 baseline:
> - Hackbench : +7.2% performance gain at 16 threads.
> - Schbench: Reduced p99.9 tail latencies at high concurrency.
I am very glad to see this result. :)
Thanks
Huang Shijie
Powered by blists - more mailing lists