public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix bad performance in changing page attributes
@ 2018-01-26  9:03 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:03 ` [PATCH 2/2] UefiCpuPkg/CpuDxe: remove all code to flush TLB for APs Jian J Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Jian J Wang @ 2018-01-26  9:03 UTC (permalink / raw)
  To: edk2-devel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-26  9:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox