Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1339669

Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per package facility

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per package facility
Date 2016-02-22 17:00 +0100
Message-ID <r513Y-7RT-5@gated-at.bofh.it> (permalink)
References <r4Wxk-4RK-17@gated-at.bofh.it> <r4Wxk-4RK-21@gated-at.bofh.it> <r4Xto-5Eo-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 22 Feb 2016, Peter Zijlstra wrote:

> On Mon, Feb 22, 2016 at 11:07:02AM -0000, Thomas Gleixner wrote:
> > +static inline struct rapl_pmu *cpu_to_rapl_pmu(unsigned int cpu)
> > +{
> > +	return rapl_pmus->pmus[topology_logical_package_id(cpu)];
> > +}
> 
> > @@ -370,6 +378,7 @@ static int rapl_pmu_event_init(struct pe
> >  		return -EINVAL;
> >  
> >  	/* must be done before validate_group */
> > +	pmu = cpu_to_rapl_pmu(event->cpu);
> >  	event->cpu = pmu->cpu;
> >  	event->pmu_private = pmu;
> 
> This again looks like pmu_private is 'trivially' replacable with
> something like:
> 
> static inline struct rapl_pmu *event_to_rapl_pmu(struct perf_event *event)
> {
> 	return cpu_to_rapl_pmu(event->cpu);
> }

Yes, it is. But that's 3 loads versus 1 and we have that in the perf fastpath,
so I prefer to keep the pmu_private add on.

Thanks,

	tglx

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[patch V2 26/28] x86/perf/intel/rapl: Convert it to a per package  facility Thomas Gleixner <tglx@linutronix.de> - 2016-02-22 12:10 +0100
  Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per  package facility Peter Zijlstra <peterz@infradead.org> - 2016-02-22 13:10 +0100
    Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per package  facility Thomas Gleixner <tglx@linutronix.de> - 2016-02-22 17:00 +0100
      Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per  package facility Peter Zijlstra <peterz@infradead.org> - 2016-02-22 17:10 +0100

csiph-web