mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Pierre.Gondois@arm.com, linux-kernel@vger.kernel.org,
	xuewen.yan@unisoc.com, qperret@qperret.net
Cc: Lukasz.Luba@arm.com, Vincent.Donnefort@arm.com, mingo@redhat.com,
	peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com
Subject: Re: [PATCH v2 2/2] sched/fair: Fix negative energy delta in find_energy_efficient_cpu()
Date: Mon, 3 May 2021 14:52:35 +0200	[thread overview]
Message-ID: <013382c7-bccf-9e49-4a6b-5542cdd4abba@arm.com> (raw)
In-Reply-To: <20210429101948.31224-3-Pierre.Gondois@arm.com>

On 29/04/2021 12:19, Pierre.Gondois@arm.com wrote:
> From: Pierre Gondois <Pierre.Gondois@arm.com>

[...]

> @@ -6680,25 +6686,23 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
>  			}
>  		}
>  	}
> -unlock:
> +

No need for empty line.

>  	rcu_read_unlock();
>  
>  	/*
>  	 * Pick the best CPU if prev_cpu cannot be used, or if it saves at
>  	 * least 6% of the energy used by prev_cpu.
>  	 */
> -	if (prev_delta == ULONG_MAX)
> -		return best_energy_cpu;
> -
> -	if ((prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
> -		return best_energy_cpu;
> +	if ((prev_delta == ULONG_MAX) ||
> +		(prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
> +		target = best_energy_cpu;

       if ((prev_delta == ULONG_MAX) ||
-               (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
+           (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
                target = best_energy_cpu;

IMHO, using whitespaces to align both sub-conditions here makes it more
readable. Especially since braces aren't required around single
statements with a condition spanning over multiple lines.

[...]

With these minor things sorted:

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>

  parent reply	other threads:[~2021-05-03 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 10:19 [PATCH v2 0/2] sched/fair: find_energy_efficient_cpu() enhancements Pierre.Gondois
2021-04-29 10:19 ` [PATCH v2 1/2] sched/fair: Only compute base_energy_pd if necessary Pierre.Gondois
2021-04-30 11:03   ` Lukasz Luba
2021-05-03 12:52   ` Dietmar Eggemann
2021-04-29 10:19 ` [PATCH v2 2/2] sched/fair: Fix negative energy delta in find_energy_efficient_cpu() Pierre.Gondois
2021-04-30 11:13   ` Lukasz Luba
2021-05-03 12:52   ` Dietmar Eggemann [this message]
2021-05-04  9:27   ` Vincent Donnefort

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=013382c7-bccf-9e49-4a6b-5542cdd4abba@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=Lukasz.Luba@arm.com \
    --cc=Pierre.Gondois@arm.com \
    --cc=Vincent.Donnefort@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.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=qperret@qperret.net \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=xuewen.yan@unisoc.com \
    /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®