From febd117a3b600df001303488ee123abba24a1b0f Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Thu, 30 Sep 2010 04:40:31 +0000 Subject: [PATCH] [NTOS]: He's climbing in yo PFN database, he snatching yo pages up, tryin to page em so y'all need to hide your pool hide your cache, and hide your working set cuz they grabbin' all the pages out there. We gonna page you, we gonna page you, so you can run and fault on that, run and fault on that, home boy, homeboy, home homeboy. Enable ARM3 Paged Pool and remove all related deprecated code. Install tested on several VMs, it might cause new regressions. Let's fix them before 0.3.13 instead of reverting. svn path=/trunk/; revision=48940 --- reactos/ntoskrnl/ex/init.c | 5 ----- reactos/ntoskrnl/mm/ARM3/expool.c | 20 ------------------- reactos/ntoskrnl/mm/mmfault.c | 32 ------------------------------- reactos/ntoskrnl/mm/mminit.c | 27 +------------------------- reactos/ntoskrnl/mm/ppool.c | 24 ----------------------- 5 files changed, 1 insertion(+), 107 deletions(-) diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 6ccccdb0b19..650de252895 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1270,8 +1270,6 @@ ExpInitializeExecutive(IN ULONG Cpu, SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_ARCHITECTURE; } -extern BOOLEAN AllowPagedPool; - VOID NTAPI Phase1InitializationDiscard(IN PVOID Context) @@ -1891,9 +1889,6 @@ Phase1InitializationDiscard(IN PVOID Context) /* Update progress bar */ InbvUpdateProgressBar(90); - /* Enough fun for now */ - AllowPagedPool = FALSE; - /* Launch initial process */ ProcessInfo = &InitBuffer->ProcessInfo; ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment); diff --git a/reactos/ntoskrnl/mm/ARM3/expool.c b/reactos/ntoskrnl/mm/ARM3/expool.c index 83d62b785ac..4a93c072a86 100644 --- a/reactos/ntoskrnl/mm/ARM3/expool.c +++ b/reactos/ntoskrnl/mm/ARM3/expool.c @@ -19,8 +19,6 @@ #undef ExAllocatePoolWithQuota #undef ExAllocatePoolWithQuotaTag -BOOLEAN AllowPagedPool = TRUE; - /* GLOBALS ********************************************************************/ ULONG ExpNumberOfPagedPools; @@ -454,11 +452,6 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType, PPOOL_HEADER Entry, NextEntry, FragmentEntry; KIRQL OldIrql; ULONG BlockSize, i; - - // - // Check for paged pool - // - if (!(AllowPagedPool) && (PoolType == PagedPool)) return ExAllocatePagedPoolWithTag(PagedPool, NumberOfBytes, Tag); // // Some sanity checks @@ -760,19 +753,6 @@ ExFreePoolWithTag(IN PVOID P, PPOOL_DESCRIPTOR PoolDesc; BOOLEAN Combined = FALSE; - // - // Check for paged pool - // - if ((P >= MmPagedPoolBase) && - (P <= (PVOID)((ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize))) - { - // - // Use old allocator - // - ExFreePagedPool(P); - return; - } - // // Quickly deal with big page allocations // diff --git a/reactos/ntoskrnl/mm/mmfault.c b/reactos/ntoskrnl/mm/mmfault.c index 308686df707..269a1659fe6 100644 --- a/reactos/ntoskrnl/mm/mmfault.c +++ b/reactos/ntoskrnl/mm/mmfault.c @@ -105,10 +105,6 @@ MmpAccessFault(KPROCESSOR_MODE Mode, switch (MemoryArea->Type) { - case MEMORY_AREA_PAGED_POOL: - Status = STATUS_SUCCESS; - break; - case MEMORY_AREA_SECTION_VIEW: Status = MmAccessFaultSectionView(AddressSpace, MemoryArea, @@ -196,12 +192,6 @@ MmNotPresentFault(KPROCESSOR_MODE Mode, switch (MemoryArea->Type) { - case MEMORY_AREA_PAGED_POOL: - { - Status = MmCommitPagedPoolAddress((PVOID)Address, Locked); - break; - } - case MEMORY_AREA_SECTION_VIEW: Status = MmNotPresentFaultSectionView(AddressSpace, MemoryArea, @@ -293,25 +283,3 @@ MmAccessFault(IN BOOLEAN StoreInstruction, } } -NTSTATUS -NTAPI -MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) -{ - NTSTATUS Status; - PFN_NUMBER AllocatedPage; - - Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage); - if (!NT_SUCCESS(Status)) - { - MmUnlockAddressSpace(MmGetKernelAddressSpace()); - Status = MmRequestPageMemoryConsumer(MC_PPOOL, TRUE, &AllocatedPage); - MmLockAddressSpace(MmGetKernelAddressSpace()); - } - Status = - MmCreateVirtualMapping(NULL, - (PVOID)PAGE_ROUND_DOWN(Address), - PAGE_READWRITE, - &AllocatedPage, - 1); - return(Status); -} diff --git a/reactos/ntoskrnl/mm/mminit.c b/reactos/ntoskrnl/mm/mminit.c index d2db58eaaa5..edc770df944 100644 --- a/reactos/ntoskrnl/mm/mminit.c +++ b/reactos/ntoskrnl/mm/mminit.c @@ -198,21 +198,6 @@ MiInitSystemMemoryAreas() BoundaryAddressMultiple); ASSERT(Status == STATUS_SUCCESS); - // - // And now, ReactOS paged pool - // - BaseAddress = MmPagedPoolBase; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_PAGED_POOL | MEMORY_AREA_STATIC, - &BaseAddress, - MmPagedPoolSize, - PAGE_READWRITE, - &MArea, - TRUE, - 0, - BoundaryAddressMultiple); - ASSERT(Status == STATUS_SUCCESS); - // // Next, the KPCR // @@ -287,10 +272,6 @@ MiDbgDumpAddressSpace(VOID) MmSystemRangeStart, (ULONG_PTR)MmSystemRangeStart + MmBootImageSize, "Boot Loaded Image"); - DPRINT1(" 0x%p - 0x%p\t%s\n", - MmPagedPoolBase, - (ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize, - "Paged Pool"); DPRINT1(" 0x%p - 0x%p\t%s\n", MmPfnDatabase, (ULONG_PTR)MmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT), @@ -373,12 +354,7 @@ MmInitSystem(IN ULONG Phase, /* Initialize ARMĀ³ in phase 0 */ MmArmInitSystem(0, KeLoaderBlock); - - /* Put the paged pool after the loaded modules */ - MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MmSystemRangeStart + - MmBootImageSize); - MmPagedPoolSize = MM_PAGED_POOL_SIZE; - + /* Intialize system memory areas */ MiInitSystemMemoryAreas(); @@ -387,7 +363,6 @@ MmInitSystem(IN ULONG Phase, } else if (Phase == 1) { - MmInitializePagedPool(); MiInitializeUserPfnBitmap(); MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); MmInitializeRmapList(); diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index 8b086414fc5..49cc12b215a 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -14,10 +14,6 @@ #define NDEBUG #include -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitializePagedPool) -#endif - #undef ASSERT #define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); DbgBreakPoint(); } @@ -967,26 +963,6 @@ RPoolFree ( PR_POOL pool, void* Addr ) R_RELEASE_MUTEX(pool); } -VOID -INIT_FUNCTION -NTAPI -MmInitializePagedPool(VOID) -{ - /* - * We are still at a high IRQL level at this point so explicitly commit - * the first page of the paged pool before writing the first block header. - */ - MmCommitPagedPoolAddress ( (PVOID)MmPagedPoolBase, FALSE ); - - MmPagedPool = RPoolInit ( MmPagedPoolBase, - MmPagedPoolSize, - MM_POOL_ALIGNMENT, - MM_CACHE_LINE_SIZE, - PAGE_SIZE ); - - ExInitializeFastMutex(&MmPagedPool->Mutex); -} - PVOID NTAPI ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, IN ULONG NumberOfBytes,