lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170718112025.iujrikdrf2sechtp@e106622-lin>
Date:   Tue, 18 Jul 2017 12:20:25 +0100
From:   Juri Lelli <Juri.Lelli@....com>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Rafael Wysocki <rjw@...ysocki.net>, Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        linux-pm@...r.kernel.org,
        Vincent Guittot <vincent.guittot@...aro.org>,
        joelaf@...gle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: schedutil: Update last_update from
 sugov_set_iowait_boost()

Hi Viresh,

On 18/07/17 10:24, Viresh Kumar wrote:
> sg_cpu->last_update is always updated right after we call
> sugov_set_iowait_boost() and its better to update it from that routine
> itself. This makes it more readable.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> ---
>  kernel/sched/cpufreq_schedutil.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 29a397067ffa..63557b9f36b6 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -177,6 +177,8 @@ static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
>  		if (delta_ns > TICK_NSEC)
>  			sg_cpu->iowait_boost = 0;
>  	}
> +
> +	sg_cpu->last_update = time;
>  }
>  
>  static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, unsigned long *util,
> @@ -219,7 +221,6 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
>  	bool busy;
>  
>  	sugov_set_iowait_boost(sg_cpu, time, flags);
> -	sg_cpu->last_update = time;
>  
>  	if (!sugov_should_update_freq(sg_policy, time))
>  		return;
> @@ -299,7 +300,6 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time,
>  	sg_cpu->flags = flags;
>  
>  	sugov_set_iowait_boost(sg_cpu, time, flags);
> -	sg_cpu->last_update = time;

It actually belongs here, IMHO. We update other fields (util, max,
flags) before looking at iowait. Why hiding the time update into a
function dealing with only one of such fields?

Best,

- Juri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ