It seems unclear as to what the point of the Page Reference Count Table in the React...
authorReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Sun, 27 Jul 2008 22:39:54 +0000 (22:39 +0000)
committerReactOS Portable Systems Group <ros-arm-bringup@svn.reactos.org>
Sun, 27 Jul 2008 22:39:54 +0000 (22:39 +0000)
commit8daee04c2a2a35fd9eea3c2c9503b8ec59f6b036
tree6dde69fb93d117906bf9c5c284123fab6b34c138
parentac0487dfa5f64a94fa2e13f1c0d3e07ff8168947
It seems unclear as to what the point of the Page Reference Count Table in the React Addres Space structure really was. It seems an over-engineered approach that actually causes more problems
then it attempts to solve. The idea is to be able to unmap PDEs when they are not required anymore (a noble idea), which saves you 4KB of non-paged pool whenever a process frees a chunk
of 4MB memory (oversimplification). The problem is that to keep track of this, an extremly expensive series of branches, comparisons, masks and shifts is applied every single time that
a page is mapped or unmapped. It also adds 8KB of non-paged pool to keep track of the references, which in some cases can be more wasteful than keeping the page tables around.
Finally, if the process quickly allocates and de-allocates memory in the same PDE range, we will effectively map and unmap the PDE continously, fragmenting hyperspace and slowing down perf.
This patch removes this functionality from the system and re-uses the code that was already present in Mmi386ReleaseMmInfo (with some optimizations and changes) to do this unmapping when the
process exists. This should make things faster, with a very small amount of increased memory footprint (we're talking about less than 100kb of non paged pool, in worse-case scenarios).

svn path=/trunk/; revision=34865
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/mm/aspace.c
reactos/ntoskrnl/mm/i386/page.c