https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be6a6b806af7dbd1ff86c4...
commit be6a6b806af7dbd1ff86c43549d5cb7779a5b8b3 Author: Jérôme Gardou jerome.gardou@reactos.org AuthorDate: Tue Aug 3 10:57:12 2021 +0200 Commit: Jérôme Gardou jerome.gardou@reactos.org CommitDate: Tue Aug 3 10:57:12 2021 +0200
[NTOS:MM] Remove dead code --- ntoskrnl/mm/ARM3/pfnlist.c | 10 ---------- ntoskrnl/mm/balance.c | 45 --------------------------------------------- 2 files changed, 55 deletions(-)
diff --git a/ntoskrnl/mm/ARM3/pfnlist.c b/ntoskrnl/mm/ARM3/pfnlist.c index bbf4275a9df..5712f22557a 100644 --- a/ntoskrnl/mm/ARM3/pfnlist.c +++ b/ntoskrnl/mm/ARM3/pfnlist.c @@ -598,9 +598,6 @@ MiRemoveZeroPage(IN ULONG Color) return PageIndex; }
-/* HACK for keeping legacy Mm alive */ -extern BOOLEAN MmRosNotifyAvailablePage(PFN_NUMBER PageFrameIndex); - VOID NTAPI MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) @@ -628,13 +625,6 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) ASSERT(Pfn1->u4.VerifierAllocation == 0); ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
- /* HACK HACK HACK : Feed the page to legacy Mm */ - if (MmRosNotifyAvailablePage(PageFrameIndex)) - { - DPRINT1("Legacy Mm eating ARM3 page!.\n"); - return; - } - /* Get the free page list and increment its count */ ListHead = &MmFreePageListHead; ASSERT_LIST_INVARIANT(ListHead); diff --git a/ntoskrnl/mm/balance.c b/ntoskrnl/mm/balance.c index f8fce014f56..0eec51fbb88 100644 --- a/ntoskrnl/mm/balance.c +++ b/ntoskrnl/mm/balance.c @@ -29,10 +29,7 @@ MM_ALLOCATION_REQUEST, *PMM_ALLOCATION_REQUEST;
MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM]; static ULONG MiMinimumAvailablePages; -static LIST_ENTRY AllocationListHead; -static KSPIN_LOCK AllocationListLock; static ULONG MiMinimumPagesPerRun; - static CLIENT_ID MiBalancerThreadId; static HANDLE MiBalancerThreadHandle = NULL; static KEVENT MiBalancerEvent; @@ -48,8 +45,6 @@ NTAPI MmInitializeBalancer(ULONG NrAvailablePages, ULONG NrSystemPages) { memset(MiMemoryConsumers, 0, sizeof(MiMemoryConsumers)); - InitializeListHead(&AllocationListHead); - KeInitializeSpinLock(&AllocationListLock);
/* Set up targets. */ MiMinimumAvailablePages = 256; @@ -350,46 +345,6 @@ MiBalancerThread(PVOID Unused) } }
-BOOLEAN MmRosNotifyAvailablePage(PFN_NUMBER Page) -{ - PLIST_ENTRY Entry; - PMM_ALLOCATION_REQUEST Request; - PMMPFN Pfn1; - - /* Make sure the PFN lock is held */ - MI_ASSERT_PFN_LOCK_HELD(); - - if (!MiMinimumAvailablePages) - { - /* Dirty way to know if we were initialized. */ - return FALSE; - } - - Entry = ExInterlockedRemoveHeadList(&AllocationListHead, &AllocationListLock); - if (!Entry) - return FALSE; - - Request = CONTAINING_RECORD(Entry, MM_ALLOCATION_REQUEST, ListEntry); - MiZeroPhysicalPage(Page); - Request->Page = Page; - - Pfn1 = MiGetPfnEntry(Page); - ASSERT(Pfn1->u3.e2.ReferenceCount == 0); - Pfn1->u3.e2.ReferenceCount = 1; - Pfn1->u3.e1.PageLocation = ActiveAndValid; - - /* This marks the PFN as a ReactOS PFN */ - Pfn1->u4.AweAllocation = TRUE; - - /* Allocate the extra ReactOS Data and zero it out */ - Pfn1->u1.SwapEntry = 0; - Pfn1->RmapListHead = NULL; - - KeSetEvent(&Request->Event, IO_NO_INCREMENT, FALSE); - - return TRUE; -} - CODE_SEG("INIT") VOID NTAPI