- 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).


svn path=/trunk/; revision=41511
This commit is contained in:
ReactOS Portable Systems Group 2009-06-21 09:08:05 +00:00
parent e7b3dac46f
commit 88b93de202

View file

@ -85,6 +85,8 @@ MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
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 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
/*
* 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)