MdeModulePkg DxeCore: Don't cache memory mapped IO FV.
Previous DxeCore FwVol code will cache whole FvMain FV from flash that may be uncached if platform reports FvMain FVB, it will impact DXE performance. The code already has file level cache, so don’t need to cache memory mapped IO FV. It can also reduce memory consumption of caching memory mapped IO FVs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15916 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -440,7 +440,7 @@ OpenSectionStream (
|
||||
return OpenSectionStreamEx (
|
||||
SectionStreamLength,
|
||||
SectionStream,
|
||||
TRUE,
|
||||
FALSE,
|
||||
0,
|
||||
SectionStreamHandle
|
||||
);
|
||||
@ -1344,7 +1344,7 @@ FreeChildNode (
|
||||
// If it's an encapsulating section, we close the resulting section stream.
|
||||
// CloseSectionStream will free all memory associated with the stream.
|
||||
//
|
||||
CloseSectionStream (ChildNode->EncapsulatedStreamHandle);
|
||||
CloseSectionStream (ChildNode->EncapsulatedStreamHandle, TRUE);
|
||||
}
|
||||
|
||||
if (ChildNode->Event != NULL) {
|
||||
@ -1362,6 +1362,8 @@ FreeChildNode (
|
||||
SEP member function. Deletes an existing section stream
|
||||
|
||||
@param StreamHandleToClose Indicates the stream to close
|
||||
@param FreeStreamBuffer TRUE - Need to free stream buffer;
|
||||
FALSE - No need to free stream buffer.
|
||||
|
||||
@retval EFI_SUCCESS The section stream is closed sucessfully.
|
||||
@retval EFI_OUT_OF_RESOURCES Memory allocation failed.
|
||||
@ -1372,7 +1374,8 @@ FreeChildNode (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
CloseSectionStream (
|
||||
IN UINTN StreamHandleToClose
|
||||
IN UINTN StreamHandleToClose,
|
||||
IN BOOLEAN FreeStreamBuffer
|
||||
)
|
||||
{
|
||||
CORE_SECTION_STREAM_NODE *StreamNode;
|
||||
@ -1397,7 +1400,9 @@ CloseSectionStream (
|
||||
ChildNode = CHILD_SECTION_NODE_FROM_LINK (Link);
|
||||
FreeChildNode (ChildNode);
|
||||
}
|
||||
CoreFreePool (StreamNode->StreamBuffer);
|
||||
if (FreeStreamBuffer) {
|
||||
CoreFreePool (StreamNode->StreamBuffer);
|
||||
}
|
||||
CoreFreePool (StreamNode);
|
||||
Status = EFI_SUCCESS;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user