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: <20150323133944.GG23123@twins.programming.kicks-ass.net>
Date:	Mon, 23 Mar 2015 14:39:44 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Morten Rasmussen <morten.rasmussen@....com>
Cc:	mingo@...hat.com, vincent.guittot@...aro.org,
	dietmar.eggemann@....com, yuyang.du@...el.com,
	preeti@...ux.vnet.ibm.com, mturquette@...aro.org, nico@...aro.org,
	rjw@...ysocki.net, juri.lelli@....com,
	linux-kernel@...r.kernel.org, Russell King <linux@....linux.org.uk>
Subject: Re: [RFCv3 PATCH 14/48] arm: Frequency invariant scheduler
 load-tracking support

On Wed, Feb 04, 2015 at 06:30:51PM +0000, Morten Rasmussen wrote:
> +/* cpufreq callback function setting current cpu frequency */
> +void arch_scale_set_curr_freq(int cpu, unsigned long freq)
> +{
> +	atomic_long_set(&per_cpu(cpu_curr_freq, cpu), freq);
> +}
> +
> +/* cpufreq callback function setting max cpu frequency */
> +void arch_scale_set_max_freq(int cpu, unsigned long freq)
> +{
> +	atomic_long_set(&per_cpu(cpu_max_freq, cpu), freq);
> +}
> +
> +unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu)
> +{
> +	unsigned long curr = atomic_long_read(&per_cpu(cpu_curr_freq, cpu));
> +	unsigned long max = atomic_long_read(&per_cpu(cpu_max_freq, cpu));
> +
> +	if (!curr || !max)
> +		return SCHED_CAPACITY_SCALE;
> +
> +	return (curr * SCHED_CAPACITY_SCALE) / max;
> +}

so I've no idea how many cycles an (integer) division takes on ARM; but
doesn't it make sense to do this division (once) in
arch_scale_set_curr_freq() instead of every time we need the result?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ