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: <20160205174944.GG11415@e106622-lin>
Date:	Fri, 5 Feb 2016 17:49:44 +0000
From:	Juri Lelli <juri.lelli@....com>
To:	Dietmar Eggemann <dietmar.eggemann@....com>
Cc:	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
	peterz@...radead.org, vincent.guittot@...aro.org,
	robh+dt@...nel.org, mark.rutland@....com, linux@....linux.org.uk,
	sudeep.holla@....com, lorenzo.pieralisi@....com,
	catalin.marinas@....com, will.deacon@....com,
	morten.rasmussen@....com, broonie@...nel.org,
	Mark Brown <broonie@...aro.org>
Subject: Re: [PATCH v3 6/6] arm64: add sysfs cpu_capacity attribute

Hi,

On 05/02/16 17:19, Dietmar Eggemann wrote:
> Hi Juri,
> 
> On 03/02/16 11:59, Juri Lelli wrote:
> > Add a sysfs cpu_capacity attribute with which it is possible to read and
> > write (thus over-writing default values) CPUs capacity. This might be
> > useful in situation where there is no way to get proper default values
> > at boot time.
> > 
> > The new attribute shows up as:
> > 
> >  /sys/devices/system/cpu/cpu*/cpu_capacity
> > 
> > Cc: Catalin Marinas <catalin.marinas@....com>
> > Cc: Will Deacon <will.deacon@....com>
> > Cc: Mark Brown <broonie@...aro.org>
> > Cc: Sudeep Holla <sudeep.holla@....com>
> > Signed-off-by: Juri Lelli <juri.lelli@....com>
> > ---
> >  arch/arm64/kernel/topology.c | 68 ++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 68 insertions(+)
> > 
> > diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
> > index f2513a6..f05cc07 100644
> > --- a/arch/arm64/kernel/topology.c
> > +++ b/arch/arm64/kernel/topology.c
> > @@ -40,6 +40,74 @@ bool arch_wants_init_cpu_capacity(void)
> >  	return true;
> >  }
> >  
> > +#ifdef CONFIG_PROC_SYSCTL
> > +#include <asm/cpu.h>
> > +#include <linux/string.h>
> > +static ssize_t show_cpu_capacity(struct device *dev,
> > +				 struct device_attribute *attr,
> > +				 char *buf)
> > +{
> > +	struct cpu *cpu = container_of(dev, struct cpu, dev);
> > +	ssize_t rc;
> > +	int cpunum = cpu->dev.id;
> > +	unsigned long capacity = arch_scale_cpu_capacity(NULL, cpunum);
> 
> Gives me an implicit declaration of function ‘arch_scale_cpu_capacity’
> error [without the commit fbc899610e1a ("arm64: Update
> arch_scale_cpu_capacity() to reflect change to define") on your
> git://linux-arm.org/linux-jl.git upstream/default_caps_v3 branch].
> 
> Why don't you just return cpu_scale
> 
> @@ -49,10 +49,8 @@ static ssize_t show_cpu_capacity(struct device *dev,
>  {
>         struct cpu *cpu = container_of(dev, struct cpu, dev);
>         ssize_t rc;
> -       int cpunum = cpu->dev.id;
> -       unsigned long capacity = arch_scale_cpu_capacity(NULL, cpunum);
> 
> -       rc = sprintf(buf, "%lu\n", capacity);
> +       rc = sprintf(buf, "%lu\n", per_cpu(cpu_scale, cpu->dev.id));
> 
>         return rc;
>  }
> 
> to get rid of this dependency?
> 

Right! I'll fix this in the next version.

Thanks,

- Juri

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ