Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2551797rdb; Mon, 12 Feb 2024 08:21:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVvksYX00wDUFeg8f2ZSCQU09U98bA4iWZf4GWyAG6QTyMthNo8tM8cgMyTeLgMNVnVzhiWW9jKlFXjg9CG1vWc0QvzszwWLXFeGaEt9w== X-Google-Smtp-Source: AGHT+IGK1tcTadI1gjqcTT4HxeN3vcTnNUXGJPMJ8etvOwwD9qB0LqJZZU7/Yxw39L1Y9IUwWeFw X-Received: by 2002:aa7:d310:0:b0:560:8010:b678 with SMTP id p16-20020aa7d310000000b005608010b678mr4941040edq.30.1707754909280; Mon, 12 Feb 2024 08:21:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707754909; cv=pass; d=google.com; s=arc-20160816; b=iQXkqFtdSD+D0mdfNo9jZays2u7NVsWdWwlrRQCztJ9iiZHb9vrwJzxnAIWLrioCX6 z2AdXxSvzDUmmP3druIspRc97Bl6tduCSU+k+Ns1Pl90Hgj1sivSSt2e0IJ62GFLf+po scOLvxfVKs2ZVfDjiwuZyAekDfbU5zY8qxmCpgtz0C++iqtXGQ8Fcz2XWbmARkfdo+qH 9YYrNTQ9Nwx5hBzUccD20L2uJy3DNqeRdDZ8IcCaXY9ZRpnvLWlkYBFRLw7hC1cjgIHF xt3Jlc7U7FaMEH/Vb1E2s9yKmoNtYOPW71Q+PHtaZ5rNF2zc1KOY2zl2Q3+9PGZRfKox wr6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=AISrXD1Q33tYBSRVk/8iPW5GJ8FTn5xJaDxG7hZwWOQ=; fh=BeR4ptwZvOvLL3e7AAowK8ZhyTyFu8sjnzVmBgjgze8=; b=qaajwe30fCTTUtNArPp3M3/VPaX4p5t+oywg/Xwqz30na8ZID9FErRk/pmdJ4oDQsV gWzf4ua3mE23zEunWw3KG3mpSjT2plL3RhBrpmWjIXXAnbAIBloJZPDwJ5DGWygqVtDy tF9loFi/PyHsVoBtNjo+ERVpcN1i82lCOBc/TQbBqpIWK8BghEjSQ6Ac77dDg2CRyxOa H00fsJMx1xNOoa4SGl56ynqpNjwGE85tIh3GvpgE6UqpIhTA/3vkoujTVdPjIxOlNow6 ClGd+hQ0oFBmlw5TW3d7FSlJu3TLH5MyU4ccNMo1bUTfIyyy42mE8npbvSwQUK6iq8l4 KN+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3O7vg3zq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-61950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61950-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCVZ7FnHV7A0xyH/QA0hfv0GvWlSPluKcDUfQtjHe27UyHx3tTk9oH6LKHvrAHd5tVSt0KGcAKYpU+yW20R5A6ebAt1R4Gm52ID4hDdfuw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b21-20020aa7d495000000b0055fee9483aesi2916790edr.458.2024.02.12.08.21.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:21:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3O7vg3zq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-61950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61950-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B3111F21E26 for ; Mon, 12 Feb 2024 16:21:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C95E3D0DF; Mon, 12 Feb 2024 16:21:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3O7vg3zq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Dx12KB1W" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C88A83D0C6 for ; Mon, 12 Feb 2024 16:21:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707754901; cv=none; b=DlA+e6aUDTv89glPAjjbBmvmavgP4eEY8NxRvRr+UN3UlbiLmQDYKPx8T+SwrM6sQF3tCm326reSt9n/L7wlYoOmTEcCPnLHjb3i6Dwy0TeVex7W1onmhoQFN8fH3SuIAg/htBsxR7LvRWoPoCaCwFIyj7BLVtEdTYv/WGKjcRs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707754901; c=relaxed/simple; bh=1BWC0UQfvIxzQO7IVLyaJkmBdrewdliNCuz3xW/kdWo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=sjik+q57cRVzSvYhS3cPK7P9lC8kPLqOK80pgejO5HLHz8xI3GF4gdrQ/DOXsN9knThDv2qfhCHee2IDkDa+3OSYezgDH0Ox30vjkrtkCdLUH+ymr5HO2R1+GbkaW1i5XhgAVJMhp9XdjI5OUllWVmEZoSrWBMZBlHYgyhZqw/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3O7vg3zq; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Dx12KB1W; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707754897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AISrXD1Q33tYBSRVk/8iPW5GJ8FTn5xJaDxG7hZwWOQ=; b=3O7vg3zqDREBF3TLw4EqC58s9CYZtIX1d5b8glvxIM7smiIq6lkeXajBzl6ZYfahAUSGCb fvUQCwYoeX7g/xujcRsA0M4vrO0YG/4GbyGBLgEkHiNb0RxU+Xok8U3cqmkxA/ol5keekn yK5F75kCSYrbx6WYbLFKkR4LhMtblczRTIf7Y6MaSxRtngh83juNR8QO2Gj/7slZ4BOsvz nUFr8fAhwHt02Ph0j009lqqp1ijIgJVZyw/8Y4L3n9caTyUFrOCMxRl5caguz242L3FUUA SZjpc3xuJDZ+TsmFqMAmdr6P/UjcWTEMMo2iR3He9/g41DSu3q+zD7v4x7VATQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707754897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AISrXD1Q33tYBSRVk/8iPW5GJ8FTn5xJaDxG7hZwWOQ=; b=Dx12KB1WdBy2Qs4v3dwFwJ1C0JdUkfW+rGbPPCrd8swP6Xg7Lwq7YBgJFA/Gw6nUFYpwOA sJ1+7k2ogDvsQTCQ== To: "Zhang, Rui" , "linux-kernel@vger.kernel.org" Cc: "mhklinux@outlook.com" , "jgross@suse.com" , "x86@kernel.org" , "arjan@linux.intel.com" , "kprateek.nayak@amd.com" , "Tang, Feng" , "kan.liang@linux.intel.com" , "thomas.lendacky@amd.com" , "ray.huang@amd.com" , "Mehta, Sohil" , "Sivanich, Dimitri" , "paulmck@kernel.org" , "andrew.cooper3@citrix.com" , "andy@infradead.org" , "peterz@infradead.org" Subject: Re: [patch v2 25/30] x86/cpu/topology: Use topology logical mapping mechanism In-Reply-To: <5024c989133441608592ef86bc78ca2573bcc728.camel@intel.com> References: <20240118123127.055361964@linutronix.de> <20240118123649.971809766@linutronix.de> <5024c989133441608592ef86bc78ca2573bcc728.camel@intel.com> Date: Mon, 12 Feb 2024 17:21:37 +0100 Message-ID: <87r0hhk60e.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, Feb 02 2024 at 06:45, Rui Zhang wrote: >> @@ -147,6 +148,9 @@ static void topo_set_ids(struct topo_sca >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0c->topo.pkg_id =3D topo_= shift_apicid(apicid, TOPO_PKG_DOMAIN); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0c->topo.die_id =3D topo_= shift_apicid(apicid, TOPO_DIE_DOMAIN); >> =C2=A0 >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0c->topo.logical_pkg_id =3D to= pology_get_logical_id(apicid, >> TOPO_PKG_DOMAIN); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0c->topo.logical_die_id =3D to= pology_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