Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp842650rdb; Fri, 26 Jan 2024 12:23:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfj2A9qQoKhODEyzZJkPimO9OsunkOw7U3XyRl975OqsSraokT4Xb+5jyPCqgqG3sjobfu X-Received: by 2002:a17:902:cec1:b0:1d7:2fa6:bfc2 with SMTP id d1-20020a170902cec100b001d72fa6bfc2mr2338157plg.60.1706300611382; Fri, 26 Jan 2024 12:23:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706300611; cv=pass; d=google.com; s=arc-20160816; b=SAwXT7acppJ5QZGJk0Z6d3IN5NLfr78YjzUcYwDoLVI9OdnhPEs5kfdYE11KznD8AN odDJAhkxiw1Oxcn3QB0S7ftxJUqm2hsEcLQQ+bcxoJZjFdjF+Q4fjO6+zYV7fCye6v7k M8M4syijXNJZNuyVr2FCvGYTpcKAuBZWuYj1/oYFtbFxyeYi4wLRAULNSVqZUyzYvuZe MnixXJOyy5NVpL/vuI3rhUmKO/xtZMiUtVhoa+ffZ+54PvC1qz296+cBq1h5Z5I+hHRX H0FfTcc8phuG4FoTrSejPAZbvKocdW1jx+jtdi4+He7vmUh5WkO8vQC/D6GXaHuzxYHM 5L6w== 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=841xmotN080Gj8mdI3q/cuaEGS+WUt6XWaaj98SJfC0=; fh=JaFVOl+FjsaLUdwTZpRn7r+x96gvAQAvaYnPIlLaA+4=; b=qkT0ImTCGxYXYhBw3UVwvnPMZUJrBGDEOuudubiWKmwjQn8KuHS5l0mKyZRg3+S1/f Qe03K5Xb1AHBdBtbY5Vx9X2j2TJOmoepMKjlTSWQ9aCN3f7sQFkeZXwQChW+KbYPUzYf dHaX7NtxRaGsekkWilmsL58Dc/zV6LCepHRZPV+YixxXqoMOziBVsH0dZqqAz+y9EynE MV9nUCRidcL7TVr8czkiq07lVeTTmTo2j7QzkQi/TkIx5hHy3s0AlWlHZuYh34D3X+6s plDO0Y4meRHmuQYv73Jvfrp8w/NaycpQ+a/4GdG70nbGnom4bXk0XXkmY64PViJOVDWz Fsgg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oStABYS2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="e/Sdjn69"; 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-40620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t9-20020a170902bc4900b001d758a45d65si1608878plz.300.2024.01.26.12.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 12:23:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oStABYS2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="e/Sdjn69"; 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-40620-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40620-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 576F4B21487 for ; Fri, 26 Jan 2024 20:23:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F26623743; Fri, 26 Jan 2024 20:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oStABYS2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="e/Sdjn69" 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 D028122EF9 for ; Fri, 26 Jan 2024 20:22:50 +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=1706300572; cv=none; b=R4XLLL4V+JpPvbltnFwSF63WLeUpKZQBQTNZp37BgG+DTkgTox9FYGA2D7LDzEyLXFnXUZAYzYGg+5ehMhC6OrGPbp275qBoZuEWmAuBI/D8jW2L3u5FhL8yENnCoojFs06MDvd04zxtqH9C3QLtD3kZ+RgZDWZNJX8JSFGrG5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706300572; c=relaxed/simple; bh=tBU/Xb/2SvjwvzmqrK39MOJLLy+M/EBTekaRKFEliwo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=KFma2gC6Thm4ql/TnFRkMny69p7dsAgzmbN+14kMnP0kGT4tGmo568S+xq1IPqqjH2SWg6mfy/r/viQ6CqSJAqPBrTRc1qVnYMnaOedmBVIpex2qKVaGm3StWCXR+Wgz8rmvKMWLrKbfhfY1YubcwTCVDxV64BgWsocwnNQhVpg= 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=oStABYS2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=e/Sdjn69; 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=1706300568; 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=841xmotN080Gj8mdI3q/cuaEGS+WUt6XWaaj98SJfC0=; b=oStABYS2G2zTv+ODpU8P2xgVD0mZAmsxS4qF+kxGGJjfABa9k0xyZzjsZkuUiqISWJAS6F BGKw6BV2kfvKA85ploNHoWYE5F3gLoWtSFtLaZmJXKum1elDqQIJRKcPqeNBdDWYGjyrGu XgxCJS69C3D2AG9f2npYQ5Hn9TlxlEC5hFvPyrU4DsD36XD8DWX9kmJv8AQ3NrK2qo4I4p rchfG2EN3e8uTpNrwifBcXzZnhTDB+P3ijLqivtm1KX5RkDXopt+dxmwlzIALDHAm02IH+ 7dE6mqum2XDZ60UApKFMcvROvw6zmu7JO/nIbCvu24UxhWZ6sblAUS1APAcPww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706300568; 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=841xmotN080Gj8mdI3q/cuaEGS+WUt6XWaaj98SJfC0=; b=e/Sdjn69Gp/hEaJQ2kx627HStGPFxqq/vH2MJX8/rj8yPCZ2BblOJqJ49Oax65On4CCyTX Cs9s/ns5acKe1GDw== To: "Zhang, Rui" , "linux-kernel@vger.kernel.org" Cc: "Raj, Ashok" , "mhklinux@outlook.com" , "arjan@linux.intel.com" , "ray.huang@amd.com" , "thomas.lendacky@amd.com" , "andrew.cooper3@citrix.com" , "Sivanich, Dimitri" , "Tang, Feng" , "kan.liang@linux.intel.com" , "Mehta, Sohil" , "peterz@infradead.org" , "paulmck@kernel.org" , "kprateek.nayak@amd.com" , "jgross@suse.com" , "andy@infradead.org" , "x86@kernel.org" Subject: Re: [patch v2 21/30] x86/cpu/topology: Use topology bitmaps for sizing In-Reply-To: <7c8874d971c69fb4c22c1b771983f8d5109a9387.camel@intel.com> References: <20240118123127.055361964@linutronix.de> <20240118123649.739960607@linutronix.de> <7c8874d971c69fb4c22c1b771983f8d5109a9387.camel@intel.com> Date: Fri, 26 Jan 2024 21:22:47 +0100 Message-ID: <87fryjhmjs.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, Jan 26 2024 at 07:07, Zhang, Rui wrote: >> > =C2=A0 >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cnta =3D domain_weight(TOPO= _PKG_DOMAIN); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cntb =3D domain_weight(TOPO= _DIE_DOMAIN); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__max_logical_packages =3D = cnta; >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0__max_dies_per_package =3D = 1U << (get_count_order(cntb) - > >> > get_count_order(cnta)); >> > + >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_info("Max. logical packa= ges: %3u\n", cnta); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_info("Max. logical dies:= =C2=A0=C2=A0=C2=A0=C2=A0 %3u\n", cntb); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_info("Max. dies per pack= age: %3u\n", > >> > __max_dies_per_package); >> > + >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cnta =3D domain_weight(TOPO= _CORE_DOMAIN); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cntb =3D domain_weight(TOPO= _SMT_DOMAIN); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0smp_num_siblings =3D 1U << = (get_count_order(cntb) - > >> > get_count_order(cnta)); >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pr_info("Max. threads per c= ore: %3u\n", smp_num_siblings); >> > + > > I missed this but Ashok catches it. > > Say, on my Adlerlake platform, which has 4 Pcores with HT + 8 Ecores, > cnta is 12, cntb is 16, and smp_num_siblings is set to 1 erroneously. > > I think we should use > smp_num_siblings =3D DIV_ROUND_UP(cntb, cnta); > here. Indeed. That's more than obvious. > Or even check each core to get the maximum value (in case there are > more than 2 siblings in a core some day). We want to get rid of HT not make it worse.