From 88b93de202f12f5c50e2d431c64b888bf7e29361 Mon Sep 17 00:00:00 2001 From: ReactOS Portable Systems Group Date: Sun, 21 Jun 2009 09:08:05 +0000 Subject: [PATCH] - 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 --- reactos/ntoskrnl/mm/balance.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/balance.c b/reactos/ntoskrnl/mm/balance.c index c7de8152745..184b2a23630 100644 --- a/reactos/ntoskrnl/mm/balance.c +++ b/reactos/ntoskrnl/mm/balance.c @@ -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)