Skip to content

Commit febd117

Browse files
author
Sir Richard
committed
[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
1 parent 40ba0f9 commit febd117

File tree

5 files changed

+1
-107
lines changed

5 files changed

+1
-107
lines changed

reactos/ntoskrnl/ex/init.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,8 +1270,6 @@ ExpInitializeExecutive(IN ULONG Cpu,
12701270
SharedUserData->ImageNumberHigh = IMAGE_FILE_MACHINE_ARCHITECTURE;
12711271
}
12721272

1273-
extern BOOLEAN AllowPagedPool;
1274-
12751273
VOID
12761274
NTAPI
12771275
Phase1InitializationDiscard(IN PVOID Context)
@@ -1891,9 +1889,6 @@ Phase1InitializationDiscard(IN PVOID Context)
18911889
/* Update progress bar */
18921890
InbvUpdateProgressBar(90);
18931891

1894-
/* Enough fun for now */
1895-
AllowPagedPool = FALSE;
1896-
18971892
/* Launch initial process */
18981893
ProcessInfo = &InitBuffer->ProcessInfo;
18991894
ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment);

reactos/ntoskrnl/mm/ARM3/expool.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#undef ExAllocatePoolWithQuota
2020
#undef ExAllocatePoolWithQuotaTag
2121

22-
BOOLEAN AllowPagedPool = TRUE;
23-
2422
/* GLOBALS ********************************************************************/
2523

2624
ULONG ExpNumberOfPagedPools;
@@ -454,11 +452,6 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
454452
PPOOL_HEADER Entry, NextEntry, FragmentEntry;
455453
KIRQL OldIrql;
456454
ULONG BlockSize, i;
457-
458-
//
459-
// Check for paged pool
460-
//
461-
if (!(AllowPagedPool) && (PoolType == PagedPool)) return ExAllocatePagedPoolWithTag(PagedPool, NumberOfBytes, Tag);
462455

463456
//
464457
// Some sanity checks
@@ -760,19 +753,6 @@ ExFreePoolWithTag(IN PVOID P,
760753
PPOOL_DESCRIPTOR PoolDesc;
761754
BOOLEAN Combined = FALSE;
762755

763-
//
764-
// Check for paged pool
765-
//
766-
if ((P >= MmPagedPoolBase) &&
767-
(P <= (PVOID)((ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize)))
768-
{
769-
//
770-
// Use old allocator
771-
//
772-
ExFreePagedPool(P);
773-
return;
774-
}
775-
776756
//
777757
// Quickly deal with big page allocations
778758
//

reactos/ntoskrnl/mm/mmfault.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ MmpAccessFault(KPROCESSOR_MODE Mode,
105105

106106
switch (MemoryArea->Type)
107107
{
108-
case MEMORY_AREA_PAGED_POOL:
109-
Status = STATUS_SUCCESS;
110-
break;
111-
112108
case MEMORY_AREA_SECTION_VIEW:
113109
Status = MmAccessFaultSectionView(AddressSpace,
114110
MemoryArea,
@@ -196,12 +192,6 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
196192

197193
switch (MemoryArea->Type)
198194
{
199-
case MEMORY_AREA_PAGED_POOL:
200-
{
201-
Status = MmCommitPagedPoolAddress((PVOID)Address, Locked);
202-
break;
203-
}
204-
205195
case MEMORY_AREA_SECTION_VIEW:
206196
Status = MmNotPresentFaultSectionView(AddressSpace,
207197
MemoryArea,
@@ -293,25 +283,3 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
293283
}
294284
}
295285

296-
NTSTATUS
297-
NTAPI
298-
MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
299-
{
300-
NTSTATUS Status;
301-
PFN_NUMBER AllocatedPage;
302-
303-
Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage);
304-
if (!NT_SUCCESS(Status))
305-
{
306-
MmUnlockAddressSpace(MmGetKernelAddressSpace());
307-
Status = MmRequestPageMemoryConsumer(MC_PPOOL, TRUE, &AllocatedPage);
308-
MmLockAddressSpace(MmGetKernelAddressSpace());
309-
}
310-
Status =
311-
MmCreateVirtualMapping(NULL,
312-
(PVOID)PAGE_ROUND_DOWN(Address),
313-
PAGE_READWRITE,
314-
&AllocatedPage,
315-
1);
316-
return(Status);
317-
}

reactos/ntoskrnl/mm/mminit.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,6 @@ MiInitSystemMemoryAreas()
198198
BoundaryAddressMultiple);
199199
ASSERT(Status == STATUS_SUCCESS);
200200

201-
//
202-
// And now, ReactOS paged pool
203-
//
204-
BaseAddress = MmPagedPoolBase;
205-
Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
206-
MEMORY_AREA_PAGED_POOL | MEMORY_AREA_STATIC,
207-
&BaseAddress,
208-
MmPagedPoolSize,
209-
PAGE_READWRITE,
210-
&MArea,
211-
TRUE,
212-
0,
213-
BoundaryAddressMultiple);
214-
ASSERT(Status == STATUS_SUCCESS);
215-
216201
//
217202
// Next, the KPCR
218203
//
@@ -287,10 +272,6 @@ MiDbgDumpAddressSpace(VOID)
287272
MmSystemRangeStart,
288273
(ULONG_PTR)MmSystemRangeStart + MmBootImageSize,
289274
"Boot Loaded Image");
290-
DPRINT1(" 0x%p - 0x%p\t%s\n",
291-
MmPagedPoolBase,
292-
(ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize,
293-
"Paged Pool");
294275
DPRINT1(" 0x%p - 0x%p\t%s\n",
295276
MmPfnDatabase,
296277
(ULONG_PTR)MmPfnDatabase + (MxPfnAllocation << PAGE_SHIFT),
@@ -373,12 +354,7 @@ MmInitSystem(IN ULONG Phase,
373354

374355
/* Initialize ARM³ in phase 0 */
375356
MmArmInitSystem(0, KeLoaderBlock);
376-
377-
/* Put the paged pool after the loaded modules */
378-
MmPagedPoolBase = (PVOID)PAGE_ROUND_UP((ULONG_PTR)MmSystemRangeStart +
379-
MmBootImageSize);
380-
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
381-
357+
382358
/* Intialize system memory areas */
383359
MiInitSystemMemoryAreas();
384360

@@ -387,7 +363,6 @@ MmInitSystem(IN ULONG Phase,
387363
}
388364
else if (Phase == 1)
389365
{
390-
MmInitializePagedPool();
391366
MiInitializeUserPfnBitmap();
392367
MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
393368
MmInitializeRmapList();

reactos/ntoskrnl/mm/ppool.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
#define NDEBUG
1515
#include <debug.h>
1616

17-
#if defined (ALLOC_PRAGMA)
18-
#pragma alloc_text(INIT, MmInitializePagedPool)
19-
#endif
20-
2117
#undef ASSERT
2218
#define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); DbgBreakPoint(); }
2319

@@ -967,26 +963,6 @@ RPoolFree ( PR_POOL pool, void* Addr )
967963
R_RELEASE_MUTEX(pool);
968964
}
969965

970-
VOID
971-
INIT_FUNCTION
972-
NTAPI
973-
MmInitializePagedPool(VOID)
974-
{
975-
/*
976-
* We are still at a high IRQL level at this point so explicitly commit
977-
* the first page of the paged pool before writing the first block header.
978-
*/
979-
MmCommitPagedPoolAddress ( (PVOID)MmPagedPoolBase, FALSE );
980-
981-
MmPagedPool = RPoolInit ( MmPagedPoolBase,
982-
MmPagedPoolSize,
983-
MM_POOL_ALIGNMENT,
984-
MM_CACHE_LINE_SIZE,
985-
PAGE_SIZE );
986-
987-
ExInitializeFastMutex(&MmPagedPool->Mutex);
988-
}
989-
990966
PVOID NTAPI
991967
ExAllocatePagedPoolWithTag (IN POOL_TYPE PoolType,
992968
IN ULONG NumberOfBytes,

0 commit comments

Comments
 (0)