Author: sir_richard Date: Sat Feb 20 15:47:23 2010 New Revision: 45635
URL: http://svn.reactos.org/svn/reactos?rev=45635&view=rev Log: [NTOS]: Remove SwapEntry parameter from MmAllocPage since it was always zero. [NTOS]: Store SwapEntry as WsIndex. We can do this now since Flink is only used when the page is in a list (meaning it's not active, ie. free or zero), and non-active pages don't have a swap entry.
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c trunk/reactos/ntoskrnl/mm/ARM3/mminit.c trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/ARM3/pool.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/ntoskrnl/mm/balance.c trunk/reactos/ntoskrnl/mm/freelist.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/m... ============================================================================== --- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -1339,8 +1339,7 @@ PFN_TYPE NTAPI MmAllocPage( - ULONG Consumer, - SWAPENTRY SavedSwapEntry + ULONG Consumer );
LONG
Modified: trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/i386/init.... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/i386/init.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -547,7 +547,7 @@ // // Allocate a page for it and create it // - PageFrameIndex = MmAllocPage(MC_SYSTEM, 0); + PageFrameIndex = MmAllocPage(MC_SYSTEM); TempPde.u.Hard.PageFrameNumber = PageFrameIndex; TempPde.u.Hard.Global = FALSE; // Hyperspace is local! ASSERT(StartPde->u.Hard.Valid == 0);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mminit.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -1251,7 +1251,7 @@ // // Allocate a page and map the first paged pool PDE // - PageFrameIndex = MmAllocPage(MC_NPPOOL, 0); + PageFrameIndex = MmAllocPage(MC_NPPOOL); TempPte.u.Hard.PageFrameNumber = PageFrameIndex; ASSERT(PointerPde->u.Hard.Valid == 0); ASSERT(TempPte.u.Hard.Valid == 1);
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -97,7 +97,7 @@ // // Get a page // - PageFrameNumber = MmAllocPage(MC_PPOOL, 0); + PageFrameNumber = MmAllocPage(MC_PPOOL); DPRINT("New pool page: %lx\n", PageFrameNumber);
//
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pool.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -236,7 +236,7 @@ // // Request a paged pool page and write the PFN for it // - PageFrameNumber = MmAllocPage(MC_PPOOL, 0); + PageFrameNumber = MmAllocPage(MC_PPOOL); TempPte.u.Hard.PageFrameNumber = PageFrameNumber;
// @@ -499,7 +499,7 @@ // // Allocate a page // - PageFrameNumber = MmAllocPage(MC_NPPOOL, 0); + PageFrameNumber = MmAllocPage(MC_NPPOOL);
// // Get the PFN entry for it
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c?... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/procsup.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -158,7 +158,7 @@ // // Get a page // - PageFrameIndex = MmAllocPage(MC_NPPOOL, 0); + PageFrameIndex = MmAllocPage(MC_NPPOOL); TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
// @@ -257,7 +257,7 @@ // // Get a page // - PageFrameIndex = MmAllocPage(MC_NPPOOL, 0); + PageFrameIndex = MmAllocPage(MC_NPPOOL); TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
//
Modified: trunk/reactos/ntoskrnl/mm/balance.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -260,7 +260,7 @@ if ((Consumer == MC_NPPOOL) || (Consumer == MC_SYSTEM) || MiIsBalancerThread()) { OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - Page = MmAllocPage(Consumer, 0); + Page = MmAllocPage(Consumer); KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); if (Page == 0) { @@ -326,7 +326,7 @@ * Actually allocate the page. */ OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - Page = MmAllocPage(Consumer, 0); + Page = MmAllocPage(Consumer); KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); if (Page == 0) {
Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev=... ============================================================================== --- trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/freelist.c [iso-8859-1] Sat Feb 20 15:47:23 2010 @@ -30,7 +30,6 @@ // REACTOS NT // #define RmapListHead AweReferenceCount -#define SavedSwapEntry u4.EntireFrame #define PHYSICAL_PAGE MMPFN #define PPHYSICAL_PAGE PMMPFN
@@ -255,7 +254,6 @@ // MiRemoveFromList(Pfn1); Pfn1->u3.e2.ReferenceCount = 1; - Pfn1->SavedSwapEntry = 0;
// // Check if it was already zeroed @@ -448,7 +446,6 @@ Pfn1->u3.e1.StartOfAllocation = 1; Pfn1->u3.e1.EndOfAllocation = 1; Pfn1->u3.e2.ReferenceCount = 1; - Pfn1->SavedSwapEntry = 0;
// // Decrease available pages @@ -497,7 +494,6 @@ Pfn1->u3.e2.ReferenceCount = 1; Pfn1->u3.e1.StartOfAllocation = 1; Pfn1->u3.e1.EndOfAllocation = 1; - Pfn1->SavedSwapEntry = 0;
// // Decrease available pages @@ -747,7 +743,7 @@ KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MiGetPfnEntry(Pfn)->SavedSwapEntry = SwapEntry; + MiGetPfnEntry(Pfn)->u1.WsIndex = SwapEntry; KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql); }
@@ -759,7 +755,7 @@ KIRQL oldIrql;
oldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - SwapEntry = MiGetPfnEntry(Pfn)->SavedSwapEntry; + SwapEntry = MiGetPfnEntry(Pfn)->u1.WsIndex; KeReleaseQueuedSpinLock(LockQueuePfnLock, oldIrql);
return(SwapEntry); @@ -845,7 +841,7 @@
PFN_TYPE NTAPI -MmAllocPage(ULONG Type, SWAPENTRY SwapEntry) +MmAllocPage(ULONG Type) { PFN_TYPE PfnOffset; PPHYSICAL_PAGE PageDescriptor; @@ -876,7 +872,6 @@ }
PageDescriptor->u3.e2.ReferenceCount = 1; - PageDescriptor->SavedSwapEntry = SwapEntry;
MmAvailablePages--;