[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160302022652.GB26547@hr-amur2>
Date: Wed, 2 Mar 2016 10:26:53 +0800
From: Huang Rui <ray.huang@....com>
To: Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>
CC: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Robert Richter <rric@...nel.org>,
Jacob Shin <jacob.w.shin@...il.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...el.com>,
<linux-kernel@...r.kernel.org>, <spg_linux_kernel@....com>,
<x86@...nel.org>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
Fengguang Wu <fengguang.wu@...el.com>,
Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH v5] perf/x86/amd/power: Add AMD accumulated power
reporting mechanism
On Tue, Mar 01, 2016 at 02:58:39PM +0100, Borislav Petkov wrote:
> On Mon, Feb 29, 2016 at 12:30:47PM +0100, Thomas Gleixner wrote:
> > On Tue, 1 Mar 2016, Huang Rui wrote:
> > > On Fri, Feb 26, 2016 at 11:18:28AM +0100, Thomas Gleixner wrote:
> > > > > +static int __init amd_power_pmu_init(void)
> > > > > +{
> > > > > + int i, ret;
> > > > > + u64 tmp;
> > > > > +
> > > > > + if (!x86_match_cpu(cpu_match))
> > > > > + return 0;
> > > > > +
> > > > > + if (!boot_cpu_has(X86_FEATURE_ACC_POWER))
> > > > > + return -ENODEV;
> > > > > +
> > > > > + cores_per_cu = amd_get_cores_per_cu();
> > > > > + cu_num = boot_cpu_data.x86_max_cores / cores_per_cu;
> > > >
> > > > Please use the new package management functions which are on the way to tip.
> > > >
> > > Can you give me some hints?
> >
> > http://git.kernel.org/tip/1f12e32f4cd5243ae46d8b933181be0d022c6793
> >
> > topology_max_packages() is what you want.
>
> Rui, I think you want to use smp_num_siblings here. And we did define
> that amd_get_cores_per_cu() but that's redundant:
>
> /* get compute unit information */
> smp_num_siblings = ((ebx >> 8) & 3) + 1;
> c->compute_unit_id = ebx & 0xff;
> cores_per_cu += ((ebx >> 8) & 3);
>
> So if I'm not missing anything else, we don't need that cores_per_cu
> variable, nor do we need amd_get_cores_per_cu(). I'll zap this patch
> from my queue. You can use smp_num_siblings in your patch instead which
> is exported to everything.
>
That makes sense for me. Thanks, Boris, Thomas. We just want to know
cores number per compute unit here.
Thanks,
Rui
Powered by blists - more mailing lists