• Jeffrey Lee's avatar
    OS_ChangeDynamicArea performance optimisations · 5e11e665
    Jeffrey Lee authored
        - Apply various optimisations to OS_ChangeDynamicArea to reduce the execution time when performing large grows/shrinks.
        - Optimisations can be toggled on/off with FastCDA_* flags for debugging.
        - On a 1GHz 512MB BB-xM, the initial *FreePool call now takes 0.15s instead of 13.46s. On a 512MB Iyonix the time has dropped from 1.18s to 0.23s.
        - Growing screen memory (on BB-xM) has also seen significant gains - between 2x and 4x speedup, depending on what state the source pages are in.
        - Added/updated documentation for a few functions and made more use of ROUTs for safety
      s/ARM600, s/VMSAv6:
        - Update BangCamUpdate, etc. to add support for the PageFlags_Unsafe flag that OS_ChangeDynamicArea uses to bypass cache/TLB maintenance in some situations
        - Avoid BangCamUpdate calling BangL2PT to map out the page if the page isn't mapped in (avoids unnecessary cache/TLB flush)
        - Add extra ASSERT for safety
        - Fix incorrect assumption that the usable size of a heap block is always 8 less than the value stored in the header. Even with the old 8 byte aligned allocations the usable size will always be 4 bytes less than the value in the header. This code would have resulted in some slight memory wasteage, as AMBcontrol will have always tried growing the block four bytes bigger than needed.
      Tested on Iyonix & BB-xM
    Version 5.35, Tagged as 'Kernel-5_35-4_79_2_146'
ChangeDyn 199 KB