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

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
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 Mon, 22 Feb 2016 17:00:02 +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>
X-Original-To Peter Zijlstra <peterz@infradead.org>
User-Agent Alpine 2.11 (DEB 23 2013-08-11)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
X-Linutronix-Spam-Score -1.0
X-Linutronix-Spam-Level -
X-Linutronix-Spam-Status No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 30
Organization linux.* mail to news gateway
X-Original-Cc LKML <linux-kernel@vger.kernel.org>, x86@kernel.org, Borislav Petkov <bp@alien8.de>, Stephane Eranian <eranian@google.com>, Harish Chegondi <harish.chegondi@intel.com>, Kan Liang <kan.liang@intel.com>, Andi Kleen <andi.kleen@intel.com>, Jacob Pan <jacob.jun.pan@linux.intel.com>
X-Original-Date Mon, 22 Feb 2016 16:52:28 +0100 (CET)
X-Original-Message-ID <alpine.DEB.2.11.1602221651340.2477@nanos>
X-Original-References <20160222110337.198341739@linutronix.de> <20160222110442.423353725@linutronix.de> <20160222120818.GD6357@twins.programming.kicks-ass.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1339669

Show key headers only | 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