From: "Laszlo Ersek" <lersek@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: devel@edk2.groups.io, Oliver Steffen <osteffen@redhat.com>,
Ray Ni <ray.ni@intel.com>, Rahul Kumar <rahul1.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber()
Date: Mon, 19 Feb 2024 21:02:05 +0100 [thread overview]
Message-ID: <06ee905d-efbc-ed1e-a6ff-dfc59d7d703b@redhat.com> (raw)
In-Reply-To: <6sj7g5q4izxbcpyysed4shml4ru262qezr46qj7iykh7brqlgw@jj4wy2vngh2d>
On 2/19/24 12:37, Gerd Hoffmann wrote:
> Hi,
>
>> (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?
>
> Different HOB, but similar underlying problem.
>
> 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).
>
>> 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.
>
> Ray raised performance concerns too.
>
> 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
-=-=-=-=-=-=-=-=-=-=-=-
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]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-02-19 20:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 9:31 [edk2-devel] [PATCH 0/5] UefiCpuPkg/MpInitLib: Add support for multiple MP_HAND_OFF HOBs Gerd Hoffmann
2024-02-15 9:31 ` [edk2-devel] [PATCH 1/5] UefiCpuPkg/MpInitLib: Add ProcessorIndex argument to GetMpHandOffHob() Gerd Hoffmann
2024-02-19 2:34 ` Ni, Ray
2024-02-19 9:51 ` Gerd Hoffmann
2024-02-20 3:42 ` Ni, Ray
2024-02-19 11:18 ` Laszlo Ersek
2024-02-15 9:31 ` [edk2-devel] [PATCH 2/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to GetBspNumber() Gerd Hoffmann
2024-02-19 2:41 ` Ni, Ray
2024-02-19 11:18 ` Laszlo Ersek
2024-02-19 11:37 ` Gerd Hoffmann
2024-02-19 20:02 ` Laszlo Ersek [this message]
2024-02-15 9:31 ` [edk2-devel] [PATCH 3/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SwitchApContext() Gerd Hoffmann
2024-02-19 2:43 ` Ni, Ray
2024-02-19 11:25 ` Laszlo Ersek
2024-02-15 9:31 ` [edk2-devel] [PATCH 4/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to MpInitLibInitialize Gerd Hoffmann
2024-02-19 2:57 ` Ni, Ray
2024-02-19 11:56 ` Laszlo Ersek
2024-02-15 9:31 ` [edk2-devel] [PATCH 5/5] UefiCpuPkg/MpInitLib: Add support for multiple HOBs to SaveCpuMpData() Gerd Hoffmann
2024-02-19 3:02 ` Ni, Ray
2024-02-19 12:50 ` Laszlo Ersek
2024-02-20 7:35 ` Ni, Ray
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06ee905d-efbc-ed1e-a6ff-dfc59d7d703b@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox