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]
Date:	Thu, 10 Jul 2014 17:20:14 +0100
From:	"Javi Merino" <javi.merino@....com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Punit Agrawal <Punit.Agrawal@....com>,
	"broonie@...nel.org" <broonie@...nel.org>,
	Zhang Rui <rui.zhang@...el.com>,
	Eduardo Valentin <edubezval@...il.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>
Subject: Re: [RFC PATCH v5 09/10] thermal: add trace events to the power
 allocator governor

On Thu, Jul 10, 2014 at 04:44:51PM +0100, Steven Rostedt wrote:
> On Thu, 10 Jul 2014 15:18:47 +0100
> "Javi Merino" <javi.merino@....com> wrote:
> 
> > Add trace events for the power allocator governor and the power actor
> > interface of the cpu cooling device.
> > 
> > Cc: Zhang Rui <rui.zhang@...el.com>
> > Cc: Eduardo Valentin <edubezval@...il.com>
> > Cc: Steven Rostedt <rostedt@...dmis.org>
> > Cc: Frederic Weisbecker <fweisbec@...il.com>
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Signed-off-by: Javi Merino <javi.merino@....com>
> > ---
> >  drivers/thermal/cpu_actor.c                    |  17 ++-
> >  drivers/thermal/power_allocator.c              |  22 +++-
> >  include/trace/events/thermal_power_allocator.h | 138 +++++++++++++++++++++++++
> >  3 files changed, 173 insertions(+), 4 deletions(-)
> >  create mode 100644 include/trace/events/thermal_power_allocator.h
> > 
> > diff --git a/drivers/thermal/cpu_actor.c b/drivers/thermal/cpu_actor.c
> > index 45ea4fa92ea0..b5ed2e80e288 100644
> > --- a/drivers/thermal/cpu_actor.c
> > +++ b/drivers/thermal/cpu_actor.c
> > @@ -28,6 +28,8 @@
> >  #include <linux/printk.h>
> >  #include <linux/slab.h>
> >  
> > +#include <trace/events/thermal_power_allocator.h>
> > +
> >  /**
> >   * struct power_table - frequency to power conversion
> >   * @frequency:	frequency in KHz
> > @@ -184,11 +186,12 @@ static u32 get_static_power(struct cpu_actor *cpu_actor,
> >   */
> >  static u32 get_dynamic_power(struct cpu_actor *cpu_actor, unsigned long freq)
> >  {
> > -	int cpu;
> > -	u32 power = 0, raw_cpu_power, total_load = 0;
> > +	int i, cpu;
> > +	u32 power = 0, raw_cpu_power, total_load = 0, load_cpu[NR_CPUS];
> 
> When NR_CPUS == 1024, you just killed the stack, as you added 4K to it.
> We upped the stack recently to 16k, but still.

True, this array should be static.

> >  
> >  	raw_cpu_power = cpu_freq_to_power(cpu_actor, freq);
> >  
> > +	i = 0;
> >  	for_each_cpu(cpu, &cpu_actor->cpumask) {
> >  		u32 load;
> >  
> > @@ -198,8 +201,15 @@ static u32 get_dynamic_power(struct cpu_actor *cpu_actor, unsigned long freq)
> >  		load = get_load(cpu_actor, cpu);
> >  		power += (raw_cpu_power * load) / 100;
> >  		total_load += load;
> > +		load_cpu[i] = load;
> > +
> > +		i++;
> >  	}
> >  
> > +	trace_thermal_power_actor_cpu_get_dyn_power(&cpu_actor->cpumask, freq,
> > +						raw_cpu_power, load_cpu, i,
> > +						power);
> 
> How many CPUs are you saving load_cpu on? A trace event can't be bigger
> than a page. And the data is actually a little less than that with the
> required headers.

The biggest system I've tested it on is an 8 cpu system (with
NR_CPUS==8).  So yes, small and we haven't seen any issues.

Are you saying that we are siphoning too much data through ftrace?  He
find it really valuable to collect information during run and process
it afterwards but I can see how this may not be feasible for systems
with thousands of cpus.

--
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