From: Borislav Petkov <bp@alien8.de>
To: Thomas Gleixner <tglx@linutronix.de>, Huang Rui <ray.huang@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Andy Lutomirski <luto@amacapital.net>,
Robert Richter <rric@kernel.org>,
Jacob Shin <jacob.w.shin@gmail.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Kan Liang <kan.liang@intel.com>,
linux-kernel@vger.kernel.org, spg_linux_kernel@amd.com,
x86@kernel.org,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism
Date: Tue, 1 Mar 2016 14:58:39 +0100 [thread overview]
Message-ID: <20160301135838.GA22677@pd.tnic> (raw)
In-Reply-To: <alpine.DEB.2.11.1602291125510.3638@nanos>
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.
Thanks.
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
next prev parent reply other threads:[~2016-03-01 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 9:40 [PATCH v5] perf/x86/amd/power: Add AMD accumulated power reporting mechanism Huang Rui
2016-02-26 10:18 ` Thomas Gleixner
2016-02-26 10:29 ` Borislav Petkov
2016-02-29 15:40 ` Huang Rui
2016-02-29 18:00 ` Huang Rui
2016-02-29 11:30 ` Thomas Gleixner
2016-03-01 13:58 ` Borislav Petkov [this message]
2016-03-02 2:26 ` Huang Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160301135838.GA22677@pd.tnic \
--to=bp@alien8.de \
--cc=Aravind.Gopalakrishnan@amd.com \
--cc=acme@kernel.org \
--cc=fengguang.wu@intel.com \
--cc=jacob.w.shin@gmail.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=ray.huang@amd.com \
--cc=rric@kernel.org \
--cc=spg_linux_kernel@amd.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox