Author: ros-arm-bringup
Date: Sun Jun 21 13:08:05 2009
New Revision: 41511

URL: http://svn.reactos.org/svn/reactos?rev=41511&view=rev
Log:
- MC_NPPOOL is special-cased in the memory balancer core to always force the 
allocation of a page, even in low-memory conditions (which in ReactOS, occur 
early-on because, in a stroke of typical ReactOS genius, the balancer core is 
called before the balancer initailizes its values and thresholds). Make 
MC_SYSTEM special-cased as well, so we never fail to allocate page tables 
early-on.
- This fixes booting on systems which required enough page tables such that the 
balancer refused the allocation of new pages (around 64+16 pages for page 
tables of 4KB each, ie. 320MB).


Modified:
    trunk/reactos/ntoskrnl/mm/balance.c

Modified: trunk/reactos/ntoskrnl/mm/balance.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=41511&r1=41510&r2=41511&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Sun Jun 21 13:08:05 2009
@@ -85,6 +85,8 @@
    MiMemoryConsumers[MC_PPOOL].PagesTarget = NrAvailablePages / 2;
    MiMemoryConsumers[MC_NPPOOL].PagesTarget = 0xFFFFFFFF;
    MiMemoryConsumers[MC_NPPOOL].PagesUsed = NrSystemPages;
+   MiMemoryConsumers[MC_SYSTEM].PagesTarget = 0xFFFFFFFF;
+   MiMemoryConsumers[MC_SYSTEM].PagesUsed = 0;
 }
 
 VOID
@@ -221,7 +223,7 @@
    /*
     * Allocate always memory for the non paged pool and for the pager thread.
     */
-   if (Consumer == MC_NPPOOL || MiIsBalancerThread())
+   if ((Consumer == MC_NPPOOL) || (Consumer == MC_SYSTEM) || 
MiIsBalancerThread())
    {
       Page = MmAllocPage(Consumer, 0);
       if (Page == 0)

Reply via email to