public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Li, Zhihao" <zhihao.li@intel.com>
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Subject: [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
Date: Fri,  1 Mar 2024 15:11:47 +0800	[thread overview]
Message-ID: <20240301071147.519-1-zhihao.li@intel.com> (raw)

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4697

EvacuateTempRam function will copy the temporary memory context to the rebased
pages and the raw pages. Migrations of rebased PEIMs is from cache to memory,
while raw PEIMs is from memory to memory. So the migrations of raw PEIMs
is slower than rebased PEIMs. Experimental data indicates that changing the source
address of raw PEIMs migration will improve performance by 35%.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
---
 MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 4cd8c843cd..ca37bde482 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1,7 +1,7 @@
 /** @file
   EFI PEI Core dispatch services
 
-Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.<BR>
 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -1305,7 +1305,7 @@ EvacuateTempRam (
                     );
         ASSERT_EFI_ERROR (Status);
         RawDataFvHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)FvHeaderAddress;
-        CopyMem (RawDataFvHeader, MigratedFvHeader, (UINTN)FvHeader->FvLength);
+        CopyMem (RawDataFvHeader, FvHeader, (UINTN)FvHeader->FvLength);
         MigratedFvInfo.FvDataBase = (UINT32)(UINTN)RawDataFvHeader;
       }
 
-- 
2.26.2.windows.1


             reply	other threads:[~2024-03-01  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  7:11 Li, Zhihao [this message]
2024-03-01 12:58 ` [edk2-devel] 回复: [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance gaoliming via groups.io
2024-03-01 16:34   ` Michael Kubacki
2024-03-01 18:59 ` [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=20240301071147.519-1-zhihao.li@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