[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1602221651340.2477@nanos>
Date: Mon, 22 Feb 2016 16:52:28 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
cc: LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Borislav Petkov <bp@...en8.de>,
Stephane Eranian <eranian@...gle.com>,
Harish Chegondi <harish.chegondi@...el.com>,
Kan Liang <kan.liang@...el.com>,
Andi Kleen <andi.kleen@...el.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: Re: [patch V2 26/28] x86/perf/intel/rapl: Convert it to a per package
facility
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
Powered by blists - more mailing lists