* [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
@ 2024-03-01 7:11 Li, Zhihao
2024-03-01 12:58 ` [edk2-devel] 回复: " gaoliming via groups.io
2024-03-01 18:59 ` [edk2-devel] " Laszlo Ersek
0 siblings, 2 replies; 4+ messages in thread
From: Li, Zhihao @ 2024-03-01 7:11 UTC (permalink / raw)
To: devel; +Cc: Liming Gao
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [edk2-devel] 回复: [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
2024-03-01 7:11 [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance Li, Zhihao
@ 2024-03-01 12:58 ` gaoliming via groups.io
2024-03-01 16:34 ` Michael Kubacki
2024-03-01 18:59 ` [edk2-devel] " Laszlo Ersek
1 sibling, 1 reply; 4+ messages in thread
From: gaoliming via groups.io @ 2024-03-01 12:58 UTC (permalink / raw)
To: 'Zhihao Li', devel, mikuback
I agree this change. It should have no negative impact. Reviewed-by: Liming
Gao <gaoliming@byosoft.com.cn>
Michael:
Have you any comments for this change?
Thanks
Liming
> -----邮件原件-----
> 发件人: Zhihao Li <zhihao.li@intel.com>
> 发送时间: 2024年3月1日 15:12
> 收件人: devel@edk2.groups.io
> 抄送: Liming Gao <gaoliming@byosoft.com.cn>
> 主题: [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
>
> 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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116249): https://edk2.groups.io/g/devel/message/116249
Mute This Topic: https://groups.io/mt/104662794/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] 回复: [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
2024-03-01 12:58 ` [edk2-devel] 回复: " gaoliming via groups.io
@ 2024-03-01 16:34 ` Michael Kubacki
0 siblings, 0 replies; 4+ messages in thread
From: Michael Kubacki @ 2024-03-01 16:34 UTC (permalink / raw)
To: gaoliming, 'Zhihao Li', devel
This looks fine.
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
On 3/1/2024 7:58 AM, gaoliming wrote:
> I agree this change. It should have no negative impact. Reviewed-by: Liming
> Gao <gaoliming@byosoft.com.cn>
>
> Michael:
> Have you any comments for this change?
>
> Thanks
> Liming
>> -----邮件原件-----
>> 发件人: Zhihao Li <zhihao.li@intel.com>
>> 发送时间: 2024年3月1日 15:12
>> 收件人: devel@edk2.groups.io
>> 抄送: Liming Gao <gaoliming@byosoft.com.cn>
>> 主题: [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
>>
>> 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
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116278): https://edk2.groups.io/g/devel/message/116278
Mute This Topic: https://groups.io/mt/104662794/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance
2024-03-01 7:11 [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance Li, Zhihao
2024-03-01 12:58 ` [edk2-devel] 回复: " gaoliming via groups.io
@ 2024-03-01 18:59 ` Laszlo Ersek
1 sibling, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2024-03-01 18:59 UTC (permalink / raw)
To: devel, zhihao.li; +Cc: Liming Gao, Michael Kubacki
On 3/1/24 08:11, Li, Zhihao wrote:
> 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;
> }
>
Merged as
7 371940932d29 MdeModulePkg/Core/Pei: Improve the copy performance
via <https://github.com/tianocore/edk2/pull/5432>.
Laszlo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116283): https://edk2.groups.io/g/devel/message/116283
Mute This Topic: https://groups.io/mt/104659917/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-01 18:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-01 7:11 [edk2-devel] [PATCH v1] MdeModulePkg/Core/Pei: Improve the copy performance Li, Zhihao
2024-03-01 12:58 ` [edk2-devel] 回复: " gaoliming via groups.io
2024-03-01 16:34 ` Michael Kubacki
2024-03-01 18:59 ` [edk2-devel] " Laszlo Ersek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox