Hi, 
  FreePages() will trig DEBUG_CLEAR_MEMORY() macro to zero memory. This macro 
will only be called when BIT3 is configured in PcdDebugPropertyMask value. 
Normally, Debug Build will configure PcdDebugPropertyMask to 0x2F so that this 
macro is enabled. You can build system BIOS with PCD value 0x27 to disable it. 
Then,  try running your application. 

Thanks
Liming
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Michael Zimmermann
> Sent: Wednesday, June 08, 2016 1:35 AM
> To: Shubha Ramani <shubharam...@yahoo.com>
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Why does gBS->FreePages() take so long ?
> 
> which system are you testing this one?
> DEBUG builds of UEFI can be very slow because they do many checks and
> clear
> the memory on each alloc/free.
> 
> Thanks
> Michael
> 
> On Tue, Jun 7, 2016 at 6:36 PM, Shubha Ramani <shubharam...@yahoo.com>
> wrote:
> 
> > I'm building an edk2 application which kicks off during system boot. For
> > this application I have to allocate huge slabs of memory repeatedly (96
> > times ) - an examplewould be 1087570 pages, allocated 96 times. I'm finding
> > that it takes on the order of minutes to do gBS->FreePages() 96 times for
> > my application !
> > Here is how I allocate each time: Status =
> > gBS->AllocatePages(AllocateAnyPages, EfiBootServicesData,
> > mNum4kPagesPerCore,
> (EFI_PHYSICAL_ADDRESS*)(MemToStressStartAddr));
> >
> > For deallocation I use gBS->FreePages().
> > Is there a workaround for  this ?
> > Spending 3-4 minutes in the exit routine deallocating memory is not
> > acceptible !
> > Thanks,
> > Shubha  Shubha D. ramanishubharam...@gmail.com
> > shubharam...@yahoo.com
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to