public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: "Ni, Ray" <ray.ni@intel.com>
Cc: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	 Oliver Steffen <osteffen@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	 "Kumar, Rahul R" <rahul.r.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/5] UefiCpuPkg/MpInitLib: Add ProcessorIndex argument to GetMpHandOffHob()
Date: Mon, 19 Feb 2024 10:51:08 +0100	[thread overview]
Message-ID: <ugyfrwr75cux4rtfjkpmq2bsnzayoy2k3mli76yb6fja4k7ns7@obkywj3wnknv> (raw)
In-Reply-To: <MN6PR11MB82445D4BCABB0B85D9C8A56A8C512@MN6PR11MB8244.namprd11.prod.outlook.com>

On Mon, Feb 19, 2024 at 02:34:42AM +0000, Ni, Ray wrote:
> > +  for (GuidHob = GetFirstGuidHob (&mMpHandOffGuid);
> > +       GuidHob != NULL;
> > +       GuidHob = GetNextGuidHob (&mMpHandOffGuid, GET_NEXT_HOB
> > (GuidHob)))
> > +  {
> >      MpHandOff = (MP_HAND_OFF *)GET_GUID_HOB_DATA (GuidHob);
> > +    if (MpHandOff->ProcessorIndex == ProcessorIndex) {
> > +      return MpHandOff;
> > +    }
> 
> Gerd,
> The code is doing correctly but I have concerns about the performance impact.
> 
> With the prototype GetMpHandOffHob(), callers call it multiple times to enumerate all HOB instances.
> 
> But every call is a HOB list enumeration from top of the HOB list which may be slow in a platform
> that contains lots of HOB items and the MpHandOff HOB instances happen to be in the very bottom.
> 
> How about add another parameter "HobStart" to GetMpHandOffHob()? So that only the first call to
> GetMpHandOffHob() is a HOB list enumeration from top, latter calls start from the next HOB of the previous
> found MpHandOff HOB instance.

That will only work if the HOBs are returned in ProcessorIndex order.

That happens to be the case in my testing; the HOBs are returned in the
same order they are created by patch #5 of this series.

Is that behavior guaranteed?  MdePkg/Include/Library/HobLib.h doesn't
say anything about the ordering.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115588): https://edk2.groups.io/g/devel/message/115588
Mute This Topic: https://groups.io/mt/104369841/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-02-19  9:51 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 [this message]
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
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=ugyfrwr75cux4rtfjkpmq2bsnzayoy2k3mli76yb6fja4k7ns7@obkywj3wnknv \
    --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