A free Windows-compatible Operating System - mirrored from GitHub
Find a file
ReactOS Portable Systems Group ca525de77d - Reimplement MmAllocateContiguousMemory, MmAllocateContiguousMemorySpecifyCache, MmFreeContiguousMemory, MmFreeContiguousMemorySpecifyCache:
- Use a smarter algorithm (as described here: http://www.microsoft.com/whdc/Driver/tips/ContigMem.mspx) to first try to satisfy the allocation by a simple nonpaged pool allocation (for cached requests only).
    - This range is then checked for physical continuity, since it's not guaranteed for non-initial-pool allocations (and right now in ReactOS, it never is).
  - As a fallback, Windows NT then attempts to scan free nonpaged pool pages. This is not yet implemented since the ReactOS nonpaged pool is not usually contiguous (to the level that NT's is).
    - When the ARM pool is implemented and replaces nonpaged pool, this code path will have to be implemented.
  - As a last resort, the actual PFN database is scanned for contiguous free pages.
    - ReactOS used MmGetContiguousPages for this, which blindly scanned the PFN database. New MiFindContinuousPages will scan the physical memory descriptor block recently implemented, which avoids going over pages we already know are going to be unusable.
    - The ReactOS function also held the PFN lock for the entire duration of the scan, which is significant on systems with large memory. Instead, we make an initial unsafe scan first, and only lock when we think we've found a correct range (and we'll then reconfirm the ranges).
    - Finally, the older function actually did a double-scan to try to avoid using memory ranges under 16MB, which was useless on today's systems and also rather inefficient.
    - Other than that, the actual setup of the PFN entry is copy-pasted from the old ReactOS function, so nothing's changed there -- the page still looks the same, but the selection algorithm is faster and more accurate.
  - Once the pages are found, we piggyback on the new I/O mapping mechanism (which uses System PTEs) instead of doing it all over by hand as before.
  - Since the underlying support is still System PTEs, once again, optimizations to that component will yield significant improvements here too.

svn path=/trunk/; revision=41657
2009-06-28 05:43:12 +00:00
irc
reactos - Reimplement MmAllocateContiguousMemory, MmAllocateContiguousMemorySpecifyCache, MmFreeContiguousMemory, MmFreeContiguousMemorySpecifyCache: 2009-06-28 05:43:12 +00:00
rosapps - Only pass gcc flags to gcc. 2009-06-18 22:06:16 +00:00
rostests unbreak build of rostests 2009-06-28 00:05:51 +00:00
wallpaper