From: "Ni, Ruiyu" <ruiyu.ni@Intel.com>
To: Jian J Wang <jian.j.wang@intel.com>, edk2-devel@lists.01.org
Cc: Jiewen Yao <jiewen.yao@intel.com>,
Eric Dong <eric.dong@intel.com>, Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode
Date: Fri, 26 Jan 2018 17:14:22 +0800 [thread overview]
Message-ID: <5987f854-7b46-1d64-6901-0dff32274e29@Intel.com> (raw)
In-Reply-To: <20180126090307.6872-2-jian.j.wang@intel.com>
On 1/26/2018 5:03 PM, Jian J Wang wrote:
> The reason doing this is that we found that calling StartupAllAps() to
> flush TLB for all APs in CpuDxe driver after changing page attributes
> will spend a lot of time to complete. If there are many page attributes
> update requests, the whole system performance will be slowed down
> explicitly, including any shell command and UI operation.
>
> The solution is removing the flush operation for AP in CpuDxe driver.
> Since TLB is always flushed in HLT loop mode, we just need to enforce
> a TLB flush for mwait loop mode.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> ---
> UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 6231968c74..175a4b49e5 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -630,6 +630,12 @@ ApWakeupFunction (
> // Restore AP's volatile registers saved
> //
> RestoreVolatileRegisters (&CpuMpData->CpuData[ProcessorNumber].VolatileRegisters, TRUE);
> + } else {
> + //
> + // Due to performance concern, the CPU driver might not flush TLB for
> + // APs on spot. AP itself needs to take care of it when woken up.
> + //
> + CpuFlushTlb ();
> }
>
> if (GetApState (&CpuMpData->CpuData[ProcessorNumber]) == CpuStateReady) {
>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
--
Thanks,
Ray
next prev parent reply other threads:[~2018-01-26 9:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 9:03 [PATCH 0/2] Fix bad performance in changing page attributes Jian J Wang
2018-01-26 9:03 ` [PATCH 1/2] UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode Jian J Wang
2018-01-26 9:14 ` Ni, Ruiyu [this message]
2018-01-26 9:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
2018-01-26 9:13 ` Ni, Ruiyu
2018-01-26 9:18 ` Wang, Jian J
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=5987f854-7b46-1d64-6901-0dff32274e29@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