mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Vincent Donnefort <vincent.donnefort@arm.com>,
	peterz@infradead.org, mingo@redhat.com,
	vincent.guittot@linaro.org
Cc: linux-kernel@vger.kernel.org, morten.rasmussen@arm.com,
	chris.redpath@arm.com, qperret@google.com
Subject: Re: [PATCH v3 6/7] sched/fair: Remove task_util from effective utilization in feec()
Date: Tue, 22 Mar 2022 10:25:45 +0100	[thread overview]
Message-ID: <b26b231e-c210-2c7c-8d60-c7e77d688191@arm.com> (raw)
In-Reply-To: <20220308181957.280354-7-vincent.donnefort@arm.com>

On 08/03/2022 19:19, Vincent Donnefort wrote:

[...]

> Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>

LGTM, just a couple of small remarks.

[...]

> @@ -6681,9 +6735,11 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
>  	unsigned long prev_delta = ULONG_MAX, best_delta = ULONG_MAX;
>  	struct root_domain *rd = cpu_rq(smp_processor_id())->rd;

s/cpu_rq(smp_processor_id())/this_rq()

Maybe you can clean this up with this patch?

>  	int cpu, best_energy_cpu = prev_cpu, target = -1;
> -	unsigned long cpu_cap, util, base_energy = 0;
> +	unsigned long cpu_cap, cpu_thermal_cap, util;

cpu_cap, cpu_thermal_cap and util can be defined inside the
`for (; pd; pd = pd->next)` scope below.

[...]

> @@ -6706,6 +6762,8 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
>  	if (!task_util_est(p))
>  		goto unlock;
>  
> +	eenv_task_busy_time(&eenv, p, prev_cpu);
> +
>  	for (; pd; pd = pd->next) {
>  		unsigned long cur_delta, spare_cap, max_spare_cap = 0;

cpu_cap and spare_cap could be combined into one to save on local
variables. E.g. cpu_cap

@@ -6908,8 +6908,6 @@ static int find_energy_efficient_cpu(struct
task_struct *p, int prev_cpu)
                         util = cpu_util_next(cpu, p, cpu);
                        cpu_cap = capacity_of(cpu);
-                       spare_cap = cpu_cap;
-                       lsub_positive(&spare_cap, util);
                         /*
                         * Skip CPUs that cannot satisfy the capacity
request.
@@ -6922,15 +6920,14 @@ static int find_energy_efficient_cpu(struct
task_struct *p, int prev_cpu)
                        if (!fits_capacity(util, cpu_cap))
                                continue;
 +                       lsub_positive(&cpu_cap, util);
+
                        if (cpu == prev_cpu) {
                                /* Always use prev_cpu as a candidate. */
                                compute_prev_delta = true;
-                       } else if (spare_cap > max_spare_cap) {
-                               /*
-                                * Find the CPU with the maximum spare
capacity
-                                * in the performance domain.
-                                */
-                               max_spare_cap = spare_cap;
+                       } else if (cpu_cap > max_spare_cap) {
+                                /* Find CPU with max spare capacity in
PD. */
+                               max_spare_cap = cpu_cap;
                                max_spare_cap_cpu = cpu;
                        }

[...]

  reply	other threads:[~2022-03-22  9:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 18:19 [PATCH v3 0/7] feec() energy margin removal Vincent Donnefort
2022-03-08 18:19 ` [PATCH v3 1/7] sched/fair: Provide u64 read for 32-bits arch helper Vincent Donnefort
2022-03-08 18:19 ` [PATCH v3 2/7] sched/fair: Decay task PELT values during migration Vincent Donnefort
2022-03-21 17:23   ` Dietmar Eggemann
2022-03-08 18:19 ` [PATCH v3 3/7] sched, drivers: Remove max param from effective_cpu_util()/sched_cpu_util() Vincent Donnefort
2022-03-08 18:19 ` [PATCH v3 4/7] sched/fair: Rename select_idle_mask to select_rq_mask Vincent Donnefort
2022-03-08 18:19 ` [PATCH v3 5/7] sched/fair: Use the same cpumask per-PD throughout find_energy_efficient_cpu() Vincent Donnefort
2022-03-08 18:19 ` [PATCH v3 6/7] sched/fair: Remove task_util from effective utilization in feec() Vincent Donnefort
2022-03-22  9:25   ` Dietmar Eggemann [this message]
2022-03-08 18:19 ` [PATCH v3 7/7] sched/fair: Remove the energy margin " Vincent Donnefort
2022-03-22  9:37   ` Dietmar Eggemann

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=b26b231e-c210-2c7c-8d60-c7e77d688191@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=chris.redpath@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=vincent.donnefort@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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

all inboxes | Powered by JetHome®