[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150828102830.GB4191@hr-slim.amd.com>
Date: Fri, 28 Aug 2015 18:28:30 +0800
From: Huang Rui <ray.huang@....com>
To: Guenter Roeck <linux@...ck-us.net>
CC: Borislav Petkov <bp@...e.de>, Jean Delvare <jdelvare@...e.de>,
"Andy Lutomirski" <luto@...capital.net>,
Andreas Herrmann <herrmann.der.user@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Peter Zijlstra" <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <lenb@...nel.org>,
John Stultz <john.stultz@...aro.org>,
Frédéric Weisbecker <fweisbec@...il.com>,
<lm-sensors@...sensors.org>, <linux-kernel@...r.kernel.org>,
<x86@...nel.org>,
Andreas Herrmann <herrmann.der.user@...glemail.com>,
Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
Borislav Petkov <bp@...en8.de>,
"Fengguang Wu" <fengguang.wu@...el.com>,
Aaron Lu <aaron.lu@...el.com>, Tony Li <tony.li@....com>
Subject: Re: [PATCH 09/15] x86, amd: add accessor for number of cores per
compute unit
On Thu, Aug 27, 2015 at 10:27:46AM -0700, Guenter Roeck wrote:
> On Thu, Aug 27, 2015 at 04:07:40PM +0800, Huang Rui wrote:
> > Add an accessor function amd_get_cores_per_cu() which returns the
> > number of cores per compute unit.
> >
> > In a subsequent patch, we will use this function in fam15h_power
> > driver.
> >
> > Signed-off-by: Huang Rui <ray.huang@....com>
> > ---
> > arch/x86/include/asm/processor.h | 1 +
> > arch/x86/kernel/cpu/amd.c | 19 +++++++++++++++++--
> > 2 files changed, 18 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> > index 19577dd..831ad682 100644
> > --- a/arch/x86/include/asm/processor.h
> > +++ b/arch/x86/include/asm/processor.h
> > @@ -810,6 +810,7 @@ static inline int mpx_disable_management(void)
> >
> > extern u16 amd_get_nb_id(int cpu);
> > extern u32 amd_get_nodes_per_socket(void);
> > +extern u32 amd_get_cores_per_cu(void);
> >
> > static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
> > {
> > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
> > index 51ad2af..8ab939a 100644
> > --- a/arch/x86/kernel/cpu/amd.c
> > +++ b/arch/x86/kernel/cpu/amd.c
> > @@ -26,6 +26,9 @@
> > */
> > static u32 nodes_per_socket = 1;
> >
> > +/* cores_per_cu: stores the number of cores per compute unit */
> > +static u32 cores_per_cu = 1;
> > +
> Is this value going to be constant even if there are multiple CPUs
> in the system ? In other words, if there are multiple CPUs, do
> they always have to have the same number of cores per CU ?
>
Yes, the same type of processors have the fixed number of cores per
compute unit. Currently, the number is 2, but it might be more in
future.
Thanks,
Rui
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists