[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0331cd3b00ef6afc5f039f0343f010227ed18fa8.camel@intel.com>
Date: Sat, 12 Aug 2023 08:00:58 +0000
From: "Zhang, Rui" <rui.zhang@...el.com>
To: "tglx@...utronix.de" <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "Brown, Len" <len.brown@...el.com>,
"Gross, Jurgen" <jgross@...e.com>,
"mikelley@...rosoft.com" <mikelley@...rosoft.com>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
"x86@...nel.org" <x86@...nel.org>,
"thomas.lendacky@....com" <thomas.lendacky@....com>,
"ray.huang@....com" <ray.huang@....com>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"Sivanich, Dimitri" <dimitri.sivanich@....com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>
Subject: Re: [patch V3 23/40] x86/cpu: Provide cpu_init/parse_topology()
On Sat, 2023-08-12 at 14:38 +0800, Zhang Rui wrote:
> > +
> > +static inline u32 topo_relative_domain_id(u32 apicid, enum
> > x86_topology_domains dom)
> > +{
> > + if (dom != TOPO_SMT_DOMAIN)
> > + apicid >>= x86_topo_system.dom_shifts[dom - 1];
> > + return apicid & (x86_topo_system.dom_size[dom] - 1);
> > +}
>
> relative_domain_id() is used to get a unique id value within its next
> higher level.
>
> > +static void topo_set_ids(struct topo_scan *tscan)
> > +{
> > + struct cpuinfo_x86 *c = tscan->c;
> > + u32 apicid = c->topo.apicid;
> > +
> > + c->topo.pkg_id = topo_shift_apicid(apicid,
> > TOPO_PKG_DOMAIN);
> > + c->topo.die_id = topo_shift_apicid(apicid,
> > TOPO_DIE_DOMAIN);
And die_id is also package scope unique before this patch series.
> > +
> > + /* Relative core ID */
> > + c->topo.core_id = topo_relative_domain_id(apicid,
> > TOPO_CORE_DOMAIN);
>
> My understanding is that, to ensure a package scope unique core_id,
> rather than Module/Tile scope unique, what is really needed here is
> something like,
> apicid >>= x86_topo_system.dom_shifts[SMT];
> c->topo.core_id = apicid & (x86_topo_system.dom_size[PACKAGE]
> - 1);
>
BTW, can we consider using system wide unique core_id instead?
There are a couple of advantages by using this.
CC Len, who can provide detailed justifications for this.
thanks,
rui
Powered by blists - more mailing lists