Mars Lin,

The purpose of the gEfiMemoryTypeInformationGuid system configuration table is 
to track the peak usage of each memory type.  Not the current usage.  The 
internal data structure mMemoryTypeStatistics tracks the current usage of each 
memory type.

We need to know the peak usage of each memory type so the size of each memory 
type bin can be set to guarantee that all the allocations during an entire boot 
can fit within that bin.

I think your proposed change could produce a bin size that is smaller than the 
peak, which could result in S4 resume failures for some operating systems.

Do you agree?

Thanks,

Mike



From: Mars Lin [mailto:[email protected]]
Sent: Monday, July 14, 2014 3:04 AM
To: [email protected]
Subject: [edk2] Memory usage does not get updated when free the allocated one

Dear MdeModulePkg maintainer,
Please review attached patch file which try to correct the MemoryTypeInfo does 
not get updated within CoreConvertPages().

Steps to reproduce:
0. EfiLibGetSystemConfigurationTable (&gEfiMemoryTypeInformationGuid, 
&CurrentMemoryTypeInformation1)
1. AllocatePool (EfiBootServicesData, 0x80000, &BsData);
2. EfiLibGetSystemConfigurationTable (&gEfiMemoryTypeInformationGuid, 
&CurrentMemoryTypeInformation2)
3. FreePool (BsData)
4. EfiLibGetSystemConfigurationTable (&gEfiMemoryTypeInformationGuid, & 
CurrentMemoryTypeInformation3)

#1. CurrentMemoryTypeInformation2 get updated with EfiBootServicesData type 
grow 128 pages compare to CurrentMemoryTypeInformation1==> Correct!
#2. CurrentMemoryTypeInformation3 does not get updated with EfiBootServicesData 
type reduced 128 pages compare to CurrentMemoryTypeInformation2==> Problem!
----------------------------------------------------------------------------------------------------------------------
MdeModulePkg: Memory usage does not get updated when free the allocated one

Update gMemoryTypeInfo array when specific memory type been freed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Smith Cheng 
<[email protected]<mailto:[email protected]>>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to