From: "Ni, Ray" <ray.ni@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
edk2-devel-groups-io <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>
Subject: Re: [PATCH v2 1/2] UefiCpuPkg/MpInitLib: expand comment on initial AP enumeration
Date: Fri, 11 Oct 2019 08:19:15 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C31D12E@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191010112952.7187-2-lersek@redhat.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
> -----Original Message-----
> From: Laszlo Ersek <lersek@redhat.com>
> Sent: Thursday, October 10, 2019 7:30 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH v2 1/2] UefiCpuPkg/MpInitLib: expand comment on initial
> AP enumeration
>
> Before adding another AP enumeration mode, clarify the documentation on
> the current logic. No functional changes.
>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>
> Notes:
> v2:
> - new patch
>
> UefiCpuPkg/Library/MpInitLib/MpLib.c | 38 +++++++++++++++-----
> 1 file changed, 30 insertions(+), 8 deletions(-)
>
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index d6f84c6f45c0..594a035d8b92 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1045,14 +1045,36 @@ WakeUpAP (
> }
> if (CpuMpData->InitFlag == ApInitConfig) {
> //
> - // Here support two methods to collect AP count through adjust
> - // PcdCpuApInitTimeOutInMicroSeconds values.
> - //
> - // one way is set a value to just let the first AP to start the
> - // initialization, then through the later while loop to wait all Aps
> - // finsh the initialization.
> - // The other way is set a value to let all APs finished the initialzation.
> - // In this case, the later while loop is useless.
> + // The AP enumeration algorithm below is suitable for two use cases.
> + //
> + // (1) The check-in time for an individual AP is bounded, and APs run
> + // through their initialization routines strongly concurrently. In
> + // particular, the number of concurrently running APs
> + // ("NumApsExecuting") is never expected to fall to zero
> + // *temporarily* -- it is expected to fall to zero only when all
> + // APs have checked-in.
> + //
> + // In this case, the platform is supposed to set
> + // PcdCpuApInitTimeOutInMicroSeconds to a low-ish value (just long
> + // enough for one AP to start initialization). The timeout will be
> + // reached soon, and remaining APs are collected by watching
> + // NumApsExecuting fall to zero. If NumApsExecuting falls to zero
> + // mid-process, while some APs have not completed initialization,
> + // the behavior is undefined.
> + //
> + // (2) The check-in time for an individual AP is unbounded, and/or APs
> + // may complete their initializations widely spread out. In
> + // particular, some APs may finish initialization before some APs
> + // even start.
> + //
> + // In this case, the platform is supposed to set
> + // PcdCpuApInitTimeOutInMicroSeconds to a high-ish value. The AP
> + // enumeration will always take that long (except when the boot CPU
> + // count happens to be maximal, that is,
> + // PcdCpuMaxLogicalProcessorNumber). All APs are expected to
> + // check-in before the timeout, and NumApsExecuting is assumed zero
> + // at timeout. APs that miss the time-out may cause undefined
> + // behavior.
> //
> TimedWaitForApFinish (
> CpuMpData,
> --
> 2.19.1.3.g30247aa5d201
>
next prev parent reply other threads:[~2019-10-11 8:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-10 11:29 [PATCH v2 0/2] UefiCpuPkg/MpInitLib: introduce PcdCpuBootLogicalProcessorNumber Laszlo Ersek
2019-10-10 11:29 ` [PATCH v2 1/2] UefiCpuPkg/MpInitLib: expand comment on initial AP enumeration Laszlo Ersek
2019-10-11 8:19 ` Ni, Ray [this message]
2019-10-10 11:29 ` [PATCH v2 2/2] UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP detection Laszlo Ersek
2019-10-11 8:22 ` Ni, Ray
2019-10-11 21:31 ` [edk2-devel] " Laszlo Ersek
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=734D49CCEBEEF84792F5B80ED585239D5C31D12E@SHSMSX104.ccr.corp.intel.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