[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
This commit is contained in:
Sir Richard 2010-09-30 04:40:31 +00:00
parent 40ba0f9329
commit febd117a3b
5 changed files with 1 additions and 107 deletions

View file

@ -1270,8 +1270,6 @@ ExpInitializeExecutive(IN ULONG Cpu,
SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_ARCHITECTURE; SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_ARCHITECTURE;
} }
extern BOOLEAN AllowPagedPool;
VOID VOID
NTAPI NTAPI
Phase1InitializationDiscard(IN PVOID Context) Phase1InitializationDiscard(IN PVOID Context)
@ -1891,9 +1889,6 @@ Phase1InitializationDiscard(IN PVOID Context)
/* Update progress bar */ /* Update progress bar */
InbvUpdateProgressBar(90); InbvUpdateProgressBar(90);
/* Enough fun for now */
AllowPagedPool = FALSE;
/* Launch initial process */ /* Launch initial process */
ProcessInfo = &InitBuffer->ProcessInfo; ProcessInfo = &InitBuffer->ProcessInfo;
ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment); ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment);

View file

@ -19,8 +19,6 @@
#undef ExAllocatePoolWithQuota #undef ExAllocatePoolWithQuota
#undef ExAllocatePoolWithQuotaTag #undef ExAllocatePoolWithQuotaTag
BOOLEAN AllowPagedPool = TRUE;
/* GLOBALS ********************************************************************/ /* GLOBALS ********************************************************************/
ULONG ExpNumberOfPagedPools; ULONG ExpNumberOfPagedPools;
@ -454,11 +452,6 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
PPOOL_HEADER Entry, NextEntry, FragmentEntry; PPOOL_HEADER Entry, NextEntry, FragmentEntry;
KIRQL OldIrql; KIRQL OldIrql;
ULONG BlockSize, i; ULONG BlockSize, i;
//
// Check for paged pool
//
if (!(AllowPagedPool) && (PoolType == PagedPool)) return ExAllocatePagedPoolWithTag(PagedPool, NumberOfBytes, Tag);
// //
// Some sanity checks // Some sanity checks
@ -760,19 +753,6 @@ ExFreePoolWithTag(IN PVOID P,
PPOOL_DESCRIPTOR PoolDesc; PPOOL_DESCRIPTOR PoolDesc;
BOOLEAN Combined = FALSE; 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 // Quickly deal with big page allocations
// //

View file

@ -105,10 +105,6 @@ MmpAccessFault(KPROCESSOR_MODE Mode,
switch (MemoryArea->Type) switch (MemoryArea->Type)
{ {
case MEMORY_AREA_PAGED_POOL:
Status = STATUS_SUCCESS;
break;
case MEMORY_AREA_SECTION_VIEW: case MEMORY_AREA_SECTION_VIEW:
Status = MmAccessFaultSectionView(AddressSpace, Status = MmAccessFaultSectionView(AddressSpace,
MemoryArea, MemoryArea,
@ -196,12 +192,6 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
switch (MemoryArea->Type) switch (MemoryArea->Type)
{ {
case MEMORY_AREA_PAGED_POOL:
{
Status = MmCommitPagedPoolAddress((PVOID)Address, Locked);
break;
}
case MEMORY_AREA_SECTION_VIEW: case MEMORY_AREA_SECTION_VIEW:
Status = MmNotPresentFaultSectionView(AddressSpace, Status = MmNotPresentFaultSectionView(AddressSpace,
MemoryArea, 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);
}

View file

@ -198,21 +198,6 @@ MiInitSystemMemoryAreas()
BoundaryAddressMultiple); BoundaryAddressMultiple);
ASSERT(Status == STATUS_SUCCESS); 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 // Next, the KPCR
// //
@ -287,10 +272,6 @@ MiDbgDumpAddressSpace(VOID)
MmSystemRangeStart, MmSystemRangeStart,
(ULONG_PTR)MmSystemRangeStart + MmBootImageSize, (ULONG_PTR)MmSystemRangeStart + MmBootImageSize,
"Boot Loaded Image"); "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", DPRINT1(" 0x%p - 0x%p\t%s\n",
MmPfnDatabase, MmPfnDatabase,
(ULONG_PTR)MmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT), (ULONG_PTR)MmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT),
@ -373,12 +354,7 @@ MmInitSystem(IN ULONG Phase,
/* Initialize ARM³ in phase 0 */ /* Initialize ARM³ in phase 0 */
MmArmInitSystem(0, KeLoaderBlock); 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 */ /* Intialize system memory areas */
MiInitSystemMemoryAreas(); MiInitSystemMemoryAreas();
@ -387,7 +363,6 @@ MmInitSystem(IN ULONG Phase,
} }
else if (Phase == 1) else if (Phase == 1)
{ {
MmInitializePagedPool();
MiInitializeUserPfnBitmap(); MiInitializeUserPfnBitmap();
MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
MmInitializeRmapList(); MmInitializeRmapList();

View file

@ -14,10 +14,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
#if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitializePagedPool)
#endif
#undef ASSERT #undef ASSERT
#define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); DbgBreakPoint(); } #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); 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 PVOID NTAPI
ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType, ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType,
IN ULONG NumberOfBytes, IN ULONG NumberOfBytes,