Author: cgutman
Date: Tue Feb 28 09:30:53 2012
New Revision: 55898
URL:
http://svn.reactos.org/svn/reactos?rev=55898&view=rev
Log:
[NTOSKRNL]
- Fix PDE reference counting
- Now only the recursive fault remains as an issue in the page out path
Modified:
trunk/reactos/ntoskrnl/cache/section/data.c
trunk/reactos/ntoskrnl/cache/section/fault.c
trunk/reactos/ntoskrnl/cache/section/swapout.c
Modified: trunk/reactos/ntoskrnl/cache/section/data.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/dat…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Tue Feb 28 09:30:53 2012
@@ -676,6 +676,10 @@
MmDeleteRmap(Page, Process, Address);
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
MmReleasePageMemoryConsumer(MC_CACHE, Page);
+#if (_MI_PAGING_LEVELS == 2)
+ if (Address < MmSystemRangeStart)
+
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+#endif
}
if (SwapEntry != 0)
{
Modified: trunk/reactos/ntoskrnl/cache/section/fault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/fau…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] Tue Feb 28 09:30:53 2012
@@ -143,13 +143,12 @@
DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address);
Status = MmCreateVirtualMapping(Process, Address, Attributes, Required->Page, 1);
#if (_MI_PAGING_LEVELS == 2)
- /* Reference Page Directory Entry */
- if(Address < MmSystemRangeStart)
- {
- MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
- ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+ if (Address < MmSystemRangeStart)
+ {
+
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
}
-#endif
+#endif
if (NT_SUCCESS(Status))
{
MmInsertRmap(Required->Page[0], Process, Address);
@@ -175,11 +174,10 @@
Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1);
#if (_MI_PAGING_LEVELS == 2)
- /* Reference Page Directory Entry */
- if(Address < MmSystemRangeStart)
- {
- MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
- ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+ if (Address < MmSystemRangeStart)
+ {
+
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
}
#endif
if (NT_SUCCESS(Status))
Modified: trunk/reactos/ntoskrnl/cache/section/swapout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/swa…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/swapout.c [iso-8859-1] Tue Feb 28 09:30:53 2012
@@ -54,6 +54,7 @@
extern KEVENT MmWaitPageEvent;
extern FAST_MUTEX RmapListLock;
+extern PMMWSL MmWorkingSetList;
FAST_MUTEX MiGlobalPageOperation;
@@ -186,7 +187,6 @@
BOOLEAN Dirty,
PMM_REQUIRED_RESOURCES Required)
{
- NTSTATUS Status = STATUS_SUCCESS;
ULONG Entry;
PFN_NUMBER OurPage;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
@@ -213,14 +213,16 @@
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, &OurPage);
ASSERT(OurPage == Required->Page[0]);
- if (NT_SUCCESS(Status))
- {
- MmReleasePageMemoryConsumer(MC_CACHE, Required->Page[0]);
- }
+ MmReleasePageMemoryConsumer(MC_CACHE, Required->Page[0]);
+
+#if (_MI_PAGING_LEVELS == 2)
+ if (Address < MmSystemRangeStart)
+
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+#endif
MmUnlockSectionSegment(Segment);
MiSetPageEvent(Process, Address);
- return Status;
+ return STATUS_SUCCESS;
}
NTSTATUS