Author: sir_richard Date: Thu Feb 11 19:41:45 2010 New Revision: 45576
URL: http://svn.reactos.org/svn/reactos?rev=45576&view=rev Log: [NTOS]: Get rid of page locking mechanism for MDL since I can't see a reason this would make sense, since these pages won't be scheduled for page out anyway, and that is the only code that looked at this value.
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c trunk/reactos/ntoskrnl/mm/anonmem.c trunk/reactos/ntoskrnl/mm/mmfault.c trunk/reactos/ntoskrnl/mm/rmap.c trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c [iso-8859-1] Thu Feb 11 19:41:45 2010 @@ -966,7 +966,6 @@ // Now lock the page // MmReferencePage(PageFrameIndex); - MmLockPage(PageFrameIndex); } else { @@ -1124,7 +1123,6 @@ // // Unlock and dereference // - MmUnlockPage(*MdlPages); MmDereferencePage(*MdlPages); } } while (++MdlPages < LastPage); @@ -1218,7 +1216,6 @@ // // Unlock and dereference // - MmUnlockPage(*MdlPages); MmDereferencePage(*MdlPages); } while (++MdlPages < LastPage);
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Thu Feb 11 19:41:45 2010 @@ -258,7 +258,6 @@ PMM_REGION Region; PMM_PAGEOP PageOp; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); - KIRQL OldIrql;
/* * There is a window between taking the page fault and locking the @@ -267,12 +266,6 @@ */ if (MmIsPagePresent(NULL, Address)) { - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(MmGetPfnForProcess(NULL, Address)); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } return(STATUS_SUCCESS); }
@@ -363,12 +356,6 @@ return(Status); } MmLockAddressSpace(AddressSpace); - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(MmGetPfnForProcess(NULL, Address)); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); MmReleasePageOp(PageOp); return(STATUS_SUCCESS); @@ -440,12 +427,6 @@ /* * Finish the operation */ - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } PageOp->Status = STATUS_SUCCESS; KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE); MmReleasePageOp(PageOp);
Modified: trunk/reactos/ntoskrnl/mm/mmfault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmfault.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] Thu Feb 11 19:41:45 2010 @@ -305,7 +305,6 @@ { NTSTATUS Status; PFN_TYPE AllocatedPage; - KIRQL OldIrql;
Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage); if (!NT_SUCCESS(Status)) @@ -320,11 +319,5 @@ PAGE_READWRITE, &AllocatedPage, 1); - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(AllocatedPage); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } return(Status); }
Modified: trunk/reactos/ntoskrnl/mm/rmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=4557... ============================================================================== --- trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/rmap.c [iso-8859-1] Thu Feb 11 19:41:45 2010 @@ -202,7 +202,7 @@
ExAcquireFastMutex(&RmapListLock); entry = MmGetRmapListHeadPage(Page); - if (entry == NULL || MmGetLockCountPage(Page) != 0) + if (entry == NULL) { ExReleaseFastMutex(&RmapListLock); return(STATUS_UNSUCCESSFUL);
Modified: trunk/reactos/ntoskrnl/mm/section.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=4... ============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Thu Feb 11 19:41:45 2010 @@ -792,7 +792,6 @@ PMM_REGION Region; BOOLEAN HasSwapEntry; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); - KIRQL OldIrql;
/* * There is a window between taking the page fault and locking the @@ -801,12 +800,6 @@ */ if (MmIsPagePresent(Process, Address)) { - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(MmGetPfnForProcess(Process, Address)); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } return(STATUS_SUCCESS); }
@@ -930,12 +923,6 @@ } MmInsertRmap(Page, Process, (PVOID)PAddress); } - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } MmUnlockSectionSegment(Segment); PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); @@ -1002,12 +989,6 @@ /* * Finish the operation */ - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); DPRINT("Address 0x%.8X\n", Address); @@ -1035,16 +1016,6 @@ KeBugCheck(MEMORY_MANAGEMENT); return(Status); } - /* - * Don't add an rmap entry since the page mapped could be for - * anything. - */ - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - }
/* * Cleanup and release locks @@ -1084,12 +1055,6 @@ return(Status); } MmInsertRmap(Page, Process, (PVOID)PAddress); - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - }
/* * Cleanup and release locks @@ -1186,12 +1151,6 @@ } MmInsertRmap(Page, Process, (PVOID)PAddress);
- if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); DPRINT("Address 0x%.8X\n", Address); @@ -1262,12 +1221,6 @@ KeBugCheck(MEMORY_MANAGEMENT); } MmInsertRmap(Page, Process, (PVOID)PAddress); - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); DPRINT("Address 0x%.8X\n", Address); @@ -1296,12 +1249,6 @@ KeBugCheck(MEMORY_MANAGEMENT); } MmInsertRmap(Page, Process, (PVOID)PAddress); - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(Page); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); DPRINT("Address 0x%.8X\n", Address); @@ -1327,7 +1274,6 @@ PMM_REGION Region; ULONG Entry; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); - KIRQL OldIrql;
DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address, Locked);
@@ -1465,13 +1411,6 @@ { DPRINT1("Unable to create virtual mapping\n"); KeBugCheck(MEMORY_MANAGEMENT); - } - if (Locked) - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - MmLockPage(NewPage); - MmUnlockPage(OldPage); - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); }
/*