From: Jian J Wang <jian.j.wang@intel.com>
To: edk2-devel@lists.01.org
Subject: [PATCH 0/2] Fix bad performance in changing page attributes
Date: Fri, 26 Jan 2018 17:03:05 +0800 [thread overview]
Message-ID: <20180126090307.6872-1-jian.j.wang@intel.com> (raw)
There's a great performance down if we enable heap guard features.
This feature will frequently update page attribute to set/unset guard
pages, which is done by CpuArchProtocol.SetMemoryAttributes. In the
implementation of this method (in CpuDxe), it will call
MpProtocol.StartupAllAps() to flush TLB for all APs after updating
page attributes. We found that StartupAllAps() will spend a lot of
time to complete the flush operation. For example, listing a folder
content in shell will take 55s to complete. Normally it should take
less than 5s.
The solution is removing the flush operation for AP in CpuDxe driver
but let AP do it in its own wakeup code. There's no need to flush TLB
for AP who has no chance to run code.
Jian J Wang (2):
UefiCpuPkg/MpInitLib: force flushing TLB for AP in mwait loop mode
UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs
UefiCpuPkg/CpuDxe/CpuPageTable.c | 85 +++---------------------------------
UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +++
2 files changed, 11 insertions(+), 80 deletions(-)
--
2.15.1.windows.2
next reply other threads:[~2018-01-26 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 9:03 Jian J Wang [this message]
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
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=20180126090307.6872-1-jian.j.wang@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