[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r0hhk60e.ffs@tglx>
Date: Mon, 12 Feb 2024 17:21:37 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: "Zhang, Rui" <rui.zhang@...el.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Cc: "mhklinux@...look.com" <mhklinux@...look.com>, "jgross@...e.com"
<jgross@...e.com>, "x86@...nel.org" <x86@...nel.org>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>, "kprateek.nayak@....com"
<kprateek.nayak@....com>, "Tang, Feng" <feng.tang@...el.com>,
"kan.liang@...ux.intel.com" <kan.liang@...ux.intel.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "ray.huang@....com"
<ray.huang@....com>, "Mehta, Sohil" <sohil.mehta@...el.com>, "Sivanich,
Dimitri" <dimitri.sivanich@....com>, "paulmck@...nel.org"
<paulmck@...nel.org>, "andrew.cooper3@...rix.com"
<andrew.cooper3@...rix.com>, "andy@...radead.org" <andy@...radead.org>,
"peterz@...radead.org" <peterz@...radead.org>
Subject: Re: [patch v2 25/30] x86/cpu/topology: Use topology logical mapping
mechanism
On Fri, Feb 02 2024 at 06:45, Rui Zhang wrote:
>> @@ -147,6 +148,9 @@ static void topo_set_ids(struct topo_sca
>> c->topo.pkg_id = topo_shift_apicid(apicid, TOPO_PKG_DOMAIN);
>> c->topo.die_id = topo_shift_apicid(apicid, TOPO_DIE_DOMAIN);
>>
>> + c->topo.logical_pkg_id = topology_get_logical_id(apicid,
>> TOPO_PKG_DOMAIN);
>> + c->topo.logical_die_id = topology_get_logical_id(apicid,
>> TOPO_DIE_DOMAIN);
>> +
>
> Just wondering if we could have logical_core_id.
>
> drivers/hwmon/coretemp.c uses an array to save per core temperature
> information. We cannot use core_id as array index because it can be
> sparse. Currently, to get the temperature info for a specified core,
> we need to traverse the array to know which core each entry maps to.
>
> Ideally, we could have a global logical_core_id, and use that as the
> array index directly.
> This can also simplify kernel code in many places when checking if two
> cpus are in the same core or not.
That's trivial to do now :)
It's an orthogonal change and we can put it on top once this pile is
merged.
Thanks,
tglx
Powered by blists - more mailing lists