From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 28EE6D8108C for ; Mon, 19 Feb 2024 20:02:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6NNen7wQYDrQqHYjkPRW6uKZTHO0avAie1Fgfr5uB/c=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708372931; v=1; b=veAzdPCCwcw8Ic08suZlJdvCzrkBk5O1CUCo29E/EsMObmH1URCGww2RLlAA1E/6F0FpmcjD 91ykbhQc8LK9YXvI2gMHTd0yymVEI0CpWIEA79x+uNPgjglt2vfgLroTXj0bLMmUV9nhbYtZm4k sDdPJXdcIlFfxw1CmVj2+nfg= X-Received: by 127.0.0.2 with SMTP id 5GE0YY7687511xWPCWcyAND8; Mon, 19 Feb 2024 12:02:11 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.3929.1708372931070260990 for ; Mon, 19 Feb 2024 12:02:11 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-675-NiFeuDzBOrS_kmMi0WaZyg-1; Mon, 19 Feb 2024 15:02:08 -0500 X-MC-Unique: NiFeuDzBOrS_kmMi0WaZyg-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F36C381CB63; Mon, 19 Feb 2024 20:02:08 +0000 (UTC) X-Received: from [10.39.194.20] (unknown [10.39.194.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B2838BCC; Mon, 19 Feb 2024 20:02:06 +0000 (UTC) Message-ID: <06ee905d-efbc-ed1e-a6ff-dfc59d7d703b@redhat.com> Date: Mon, 19 Feb 2024 21:02:05 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() To: Gerd Hoffmann Cc: devel@edk2.groups.io, Oliver Steffen , Ray Ni , Rahul Kumar References: <20240215093149.251319-1-kraxel@redhat.com> <20240215093149.251319-3-kraxel@redhat.com> <392712ae-99d9-eced-2b9c-ce87403be4ce@redhat.com> <6sj7g5q4izxbcpyysed4shml4ru262qezr46qj7iykh7brqlgw@jj4wy2vngh2d> From: "Laszlo Ersek" In-Reply-To: <6sj7g5q4izxbcpyysed4shml4ru262qezr46qj7iykh7brqlgw@jj4wy2vngh2d> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: u0MUYyHqXwB8hWs5BKh8tdvVx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=veAzdPCC; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none) On 2/19/24 12:37, Gerd Hoffmann wrote: > Hi, >=20 >> (I'm missing the larger picture here -- is this related to the problem >> -- too many CPUs to fit their infos into a single HOB -- that Pawel >> worked on for a while? >=20 > Different HOB, but similar underlying problem. >=20 > At least the HOB structure already has the fields needed to allow > splitting the information into multiple HOBs, even though the current > code doesn't actually do that (which is fixed by this series). >=20 >> The outer loop is suboptimal, IMO, to just open-coding another HOB scan >> -- this approach looks quadratic, even though it could be linear. More >> or less, as proposed, we call GetMpHandOffHob() for each MP_HAND_OFF >> HOB, which will scan n/2 HOBs on average. (Even if the GUID HOB list is >> sorted by ProcessorIndex, we'll scan 1 + 2 + 3 +... HOBs.) But if we >> open-coded GetFirstGuidHob() and GetNextGuidHob() here, then a single >> scan would suffice. >=20 > Ray raised performance concerns too. >=20 > Does HobLib provides any ordering guarantees? Specifically in case the > HOBs are returned in the same order they are created (which implies they > are sorted by ProcessorIndex because patch #5 creates them in that > order) this can certainly be optimized. I don't think there are ordering guarantees, but my larger point in review is that the order does not matter. I see no reason for addressing HOBs in increasing processor index order. No loop over the HOBs that I've seen touched by this patch set seems to depend on the visiting order of HOBs. So the outer loops that advance with GetMpHandOffHob(ProcessorIndex) should be rewritable with get-next-GUID-HOB= . Laszlo -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115596): https://edk2.groups.io/g/devel/message/115596 Mute This Topic: https://groups.io/mt/104369845/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-