Author: jgardou
Date: Wed Feb 29 17:41:45 2012
New Revision: 55925
URL:
http://svn.reactos.org/svn/reactos?rev=55925&view=rev
Log:
[NTOSKRNL/MM]
- assert PDE ref count consistency everywhere
- fix the fix(tm) : after reference decrement, the maximum must not be reached
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
trunk/reactos/ntoskrnl/mm/anonmem.c
trunk/reactos/ntoskrnl/mm/marea.c
trunk/reactos/ntoskrnl/mm/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/virtual.c [iso-8859-1] Wed Feb 29 17:41:45 2012
@@ -412,7 +412,7 @@
{
DPRINT("Decrement used PTEs by address: %lx\n", Va);
(*UsedPageTableEntries)--;
- ASSERT((*UsedPageTableEntries) <= PTE_COUNT);
+ ASSERT((*UsedPageTableEntries) < PTE_COUNT);
DPRINT("Refs: %lx\n", (*UsedPageTableEntries));
/* Check if the PTE is actually mapped in */
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/anonmem.c [iso-8859-1] Wed Feb 29 17:41:45 2012
@@ -117,6 +117,7 @@
else if(Address < MmSystemRangeStart)
{
AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+
ASSERT(AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
MmUnlockAddressSpace(AddressSpace);
@@ -416,6 +417,7 @@
if(Address < MmSystemRangeStart)
{
AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+
ASSERT(AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
}
@@ -440,6 +442,7 @@
if(Address < MmSystemRangeStart)
{
AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+
ASSERT(AddressSpace->VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
}
Modified: trunk/reactos/ntoskrnl/mm/marea.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=55…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/marea.c [iso-8859-1] Wed Feb 29 17:41:45 2012
@@ -758,7 +758,7 @@
{
ASSERT(AddressSpace != MmGetKernelAddressSpace());
MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
- ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+ ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
if(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] ==
0)
{
/* No PTE relies on this PDE. Release it */
Modified: trunk/reactos/ntoskrnl/mm/section.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Wed Feb 29 17:41:45 2012
@@ -1602,6 +1602,7 @@
if(Address < MmSystemRangeStart)
{
MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
+ ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
MmLockAddressSpace(AddressSpace);
@@ -1978,7 +1979,7 @@
if((Address < MmSystemRangeStart) && (Process !=
PageOutContext->CallingProcess))
{
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
@@ -2158,7 +2159,7 @@
if(Address < MmSystemRangeStart)
{
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
MmSetSavedSwapEntryPage(Page, 0);
@@ -2186,7 +2187,7 @@
if(Address < MmSystemRangeStart)
{
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
MmSetSavedSwapEntryPage(Page, 0);
@@ -2247,7 +2248,7 @@
if(Address < MmSystemRangeStart)
{
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
MmReleasePageMemoryConsumer(MC_USER, Page);
@@ -2413,7 +2414,7 @@
if(Address < MmSystemRangeStart)
{
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
-
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
<= PTE_COUNT);
+
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]
< PTE_COUNT);
}
#endif
Entry = MAKE_SWAP_SSE(SwapEntry);