mirror of
https://github.com/reactos/reactos.git
synced 2025-05-31 23:18:39 +00:00
[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.
svn path=/trunk/; revision=49203
This commit is contained in:
parent
24811e9233
commit
a0cd959fc1
7 changed files with 15 additions and 42 deletions
|
@ -41,7 +41,7 @@ CcInitCacheZeroPage(VOID)
|
|||
{
|
||||
NTSTATUS Status;
|
||||
|
||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE, &CcZeroPage);
|
||||
Status = MmRequestPageMemoryConsumer(MC_SYSTEM, TRUE, &CcZeroPage);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Can't allocate CcZeroPage.\n");
|
||||
|
|
|
@ -547,8 +547,7 @@ QSI_DEF(SystemPerformanceInformation)
|
|||
* 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 @@ QSI_DEF(SystemPerformanceInformation)
|
|||
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 @@ QSI_DEF(SystemPerformanceInformation)
|
|||
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 */
|
||||
|
|
|
@ -114,10 +114,8 @@ typedef ULONG SWAPENTRY;
|
|||
|
||||
#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
|
||||
|
|
|
@ -373,9 +373,6 @@ MmCreateKernelStack(IN BOOLEAN GuiStack,
|
|||
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
||||
}
|
||||
|
||||
// Bug #4835
|
||||
(VOID)InterlockedExchangeAddUL(&MiMemoryConsumers[MC_NPPOOL].PagesUsed, StackPages);
|
||||
|
||||
//
|
||||
// Release the PFN lock
|
||||
//
|
||||
|
|
|
@ -47,14 +47,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
|
||||
NTAPI
|
||||
|
@ -80,13 +72,7 @@ MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages)
|
|||
{
|
||||
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 @@ MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN CanWait,
|
|||
/*
|
||||
* 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);
|
||||
|
|
|
@ -556,14 +556,7 @@ MmAllocPage(ULONG Type)
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -223,7 +223,7 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create)
|
|||
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 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create)
|
|||
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 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create)
|
|||
{
|
||||
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 @@ MmGetPageTableForProcess(PEPROCESS Process, PVOID Address, BOOLEAN Create)
|
|||
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 @@ MmDeleteVirtualMapping(PEPROCESS Process, PVOID Address, BOOLEAN FreePage,
|
|||
|
||||
if (FreePage && WasValid)
|
||||
{
|
||||
MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
|
||||
MmReleasePageMemoryConsumer(MC_SYSTEM, Pfn);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue