Author: sir_richard
Date: Tue Oct 19 16:58:27 2010
New Revision: 49203
URL:
http://svn.reactos.org/svn/reactos?rev=49203&view=rev
Log:
[NTOS]: Get rid of MC_NPPOOL and MC_PPOOL memory consumers since those are not managed by
RosMm anymore. Use MC_SYSTEM for the page table stuff that RosMm still handles, and keep
MC_USER and MC_CACHE for the current Section/VirtualMemory/Cache RosMm code.
Modified:
trunk/reactos/ntoskrnl/cc/copy.c
trunk/reactos/ntoskrnl/ex/sysinfo.c
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
trunk/reactos/ntoskrnl/mm/balance.c
trunk/reactos/ntoskrnl/mm/freelist.c
trunk/reactos/ntoskrnl/mm/i386/page.c
Modified: trunk/reactos/ntoskrnl/cc/copy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=492…
==============================================================================
--- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -41,7 +41,7 @@
{
NTSTATUS Status;
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &CcZeroPage);
+ Status = MmRequestPageMemoryConsumer(MC_SYSTEM, TRUE, &CcZeroPage);
if (!NT_SUCCESS(Status))
{
DbgPrint("Can't allocate CcZeroPage.\n");
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -547,8 +547,7 @@
* Add up all the used "Committed" memory + pagefile.
* Not sure this is right. 8^\
*/
- Spi->CommittedPages = MiMemoryConsumers[MC_PPOOL].PagesUsed +
- MiMemoryConsumers[MC_NPPOOL].PagesUsed +
+ Spi->CommittedPages = MiMemoryConsumers[MC_SYSTEM].PagesUsed +
MiMemoryConsumers[MC_CACHE].PagesUsed +
MiMemoryConsumers[MC_USER].PagesUsed +
MiUsedSwapPages;
@@ -574,10 +573,10 @@
Spi->MappedPagesWriteCount = 0; /* FIXME */
Spi->MappedWriteIoCount = 0; /* FIXME */
- Spi->PagedPoolPages = MiMemoryConsumers[MC_PPOOL].PagesUsed;
+ Spi->PagedPoolPages = 0; /* FIXME */
Spi->PagedPoolAllocs = 0; /* FIXME */
Spi->PagedPoolFrees = 0; /* FIXME */
- Spi->NonPagedPoolPages = MiMemoryConsumers[MC_NPPOOL].PagesUsed;
+ Spi->NonPagedPoolPages = 0; /* FIXME */
Spi->NonPagedPoolAllocs = 0; /* FIXME */
Spi->NonPagedPoolFrees = 0; /* FIXME */
@@ -592,7 +591,7 @@
Spi->Spare3Count = 0; /* FIXME */
Spi->ResidentSystemCachePage = MiMemoryConsumers[MC_CACHE].PagesUsed;
- Spi->ResidentPagedPoolPage = MiMemoryConsumers[MC_PPOOL].PagesUsed; /* FIXME */
+ Spi->ResidentPagedPoolPage = 0; /* FIXME */
Spi->ResidentSystemDriverPage = 0; /* FIXME */
Spi->CcFastReadNoWait = 0; /* FIXME */
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -114,10 +114,8 @@
#define MC_CACHE (0)
#define MC_USER (1)
-#define MC_PPOOL (2)
-#define MC_NPPOOL (3)
-#define MC_SYSTEM (4)
-#define MC_MAXIMUM (5)
+#define MC_SYSTEM (2)
+#define MC_MAXIMUM (3)
#define PAGED_POOL_MASK 1
#define MUST_SUCCEED_POOL_MASK 2
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -372,9 +372,6 @@
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
MI_WRITE_VALID_PTE(PointerPte, TempPte);
}
-
- // Bug #4835
- (VOID)InterlockedExchangeAddUL(&MiMemoryConsumers[MC_NPPOOL].PagesUsed,
StackPages);
//
// Release the PFN lock
Modified: trunk/reactos/ntoskrnl/mm/balance.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -46,14 +46,6 @@
static LONG MiBalancerWork = 0;
/* FUNCTIONS ****************************************************************/
-
-VOID MmPrintMemoryStatistic(VOID)
-{
- DbgPrint("MC_CACHE %d, MC_USER %d, MC_PPOOL %d, MC_NPPOOL %d, MmAvailablePages
%d\n",
- MiMemoryConsumers[MC_CACHE].PagesUsed, MiMemoryConsumers[MC_USER].PagesUsed,
- MiMemoryConsumers[MC_PPOOL].PagesUsed,
MiMemoryConsumers[MC_NPPOOL].PagesUsed,
- MmAvailablePages);
-}
VOID
INIT_FUNCTION
@@ -80,13 +72,7 @@
{
MiMemoryConsumers[MC_CACHE].PagesTarget = NrAvailablePages / 8;
}
- MiMemoryConsumers[MC_USER].PagesTarget =
- NrAvailablePages - MiMinimumAvailablePages;
- 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;
+ MiMemoryConsumers[MC_USER].PagesTarget = NrAvailablePages - MiMinimumAvailablePages;
}
VOID
@@ -261,7 +247,7 @@
/*
* Allocate always memory for the non paged pool and for the pager thread.
*/
- if ((Consumer == MC_NPPOOL) || (Consumer == MC_SYSTEM) || MiIsBalancerThread())
+ if ((Consumer == MC_SYSTEM) || MiIsBalancerThread())
{
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
Page = MmAllocPage(Consumer);
Modified: trunk/reactos/ntoskrnl/mm/freelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -556,14 +556,7 @@
PFN_NUMBER PfnOffset;
PMMPFN Pfn1;
- if (Type != MC_SYSTEM)
- {
- PfnOffset = MiRemoveZeroPage(MI_GET_NEXT_COLOR());
- }
- else
- {
- PfnOffset = MiRemoveAnyPage(MI_GET_NEXT_COLOR());
- }
+ PfnOffset = MiRemoveZeroPage(MI_GET_NEXT_COLOR());
if (!PfnOffset)
{
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Tue Oct 19 16:58:27 2010
@@ -223,7 +223,7 @@
MmDeleteHyperspaceMapping(PageDir);
return NULL;
}
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
+ Status = MmRequestPageMemoryConsumer(MC_SYSTEM, FALSE, &Pfn);
if (!NT_SUCCESS(Status) || Pfn == 0)
{
KeBugCheck(MEMORY_MANAGEMENT);
@@ -231,7 +231,7 @@
Entry = InterlockedCompareExchangePte(&PageDir[PdeOffset],
PFN_TO_PTE(Pfn) | PA_PRESENT | PA_READWRITE | PA_USER, 0);
if (Entry != 0)
{
- MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
+ MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
Pfn = PTE_TO_PFN(Entry);
}
}
@@ -280,7 +280,7 @@
{
return NULL;
}
- Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
+ Status = MmRequestPageMemoryConsumer(MC_SYSTEM, FALSE, &Pfn);
if (!NT_SUCCESS(Status) || Pfn == 0)
{
KeBugCheck(MEMORY_MANAGEMENT);
@@ -288,7 +288,7 @@
Entry = InterlockedCompareExchangePte(PageDir, PFN_TO_PTE(Pfn) | PA_PRESENT |
PA_READWRITE | PA_USER, 0);
if (Entry != 0)
{
- MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
+ MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
}
}
}
@@ -449,7 +449,7 @@
if (FreePage && WasValid)
{
- MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
+ MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
}
/*