public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Qiliang Yuan <realwujing@gmail.com>
To: vincent.guittot@linaro.org, christian.loehle@arm.com
Cc: bsegall@google.com, dietmar.eggemann@arm.com,
	juri.lelli@redhat.com, linux-kernel@vger.kernel.org,
	mgorman@suse.de, mingo@redhat.com, peterz@infradead.org,
	realwujing@gmail.com, rostedt@goodmis.org, vschneid@redhat.com,
	yuanql9@chinatelecom.cn
Subject: Re: [PATCH v2 RSEND] sched/fair: Optimize EAS energy calculation complexity from O(N) to O(1) inside inner loop
Date: Wed,  4 Feb 2026 07:11:41 -0500	[thread overview]
Message-ID: <20260204121145.3951995-1-realwujing@gmail.com> (raw)
In-Reply-To: <CAKfTPtAOHmhNv_1q0k7qxmR8tTdw3+7+UBRuKMyXNJsxoTgsbg@mail.gmail.com>

Hi Christian, Vincent,

Thank you for the detailed feedback.

On Mon, Feb 02, 2026 at 10:48:04AM +0000, Christian Loehle wrote:
> Which is still O(n), I think the title is misleading.

On Tue, Feb 03, 2026 at 06:16:27PM +0100, Vincent Guittot wrote:
> Ok, but the whole feec() remains O(n)

You are absolutely right. While the per-candidate CPU energy estimation was 
optimized, the overall complexity of find_energy_efficient_cpu() remains 
O(N). I've renamed the patch in v3 to "Optimize EAS by reducing redundant 
performance domain scans" to more accurately reflect the scope of the 
improvement.

On Mon, Feb 02, 2026 at 10:48:04AM +0000, Christian Loehle wrote:
> I don't think this is actually true. EAS doesn't really work with a large 
> number of PDs because of the expensive wakeup path.
> I don't think there's an EAS system out there where this would actually make 
> a measurable impact.

On Tue, Feb 03, 2026 at 06:16:27PM +0100, Vincent Guittot wrote:
> Could you add some figures to highlight the statement above ?

In v3, I've further optimized the path by consolidating the 'pd_max_util' and 
'pd_busy_time' calculations into the same loop that finds the 
'max_spare_cap_cpu'. This reduces the total number of full PD scans from three 
down to one per performance domain.

I agree that the impact on current mobile systems with 2-3 PDs might be subtle. 
However, as topologies grow and the wake-up path becomes more sensitive to 
cache misses, reducing redundant scans of task structures and rq utilization 
is a worthwhile constant-factor improvement. I'm investigating synthetic 
benchmarks on systems with higher core counts to provide more concrete figures.

I've sent out v3 which includes these further logic consolidations.

v3 link: https://lore.kernel.org/all/20260204120509.3950227-1-realwujing@gmail.com/

Thanks,
Qiliang

      reply	other threads:[~2026-02-04 12:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  3:05 [PATCH v2 RSEND] sched/fair: Optimize EAS energy calculation complexity from O(N) to O(1) inside inner loop Qiliang Yuan
2026-02-02 10:48 ` Christian Loehle
2026-02-03 17:16 ` Vincent Guittot
2026-02-04 12:11   ` Qiliang Yuan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260204121145.3951995-1-realwujing@gmail.com \
    --to=realwujing@gmail.com \
    --cc=bsegall@google.com \
    --cc=christian.loehle@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yuanql9@chinatelecom.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox