Author: ion
Date: Wed Feb 29 16:25:43 2012
New Revision: 55921
URL:
http://svn.reactos.org/svn/reactos?rev=55921&view=rev
Log:
[NTOSKRNL]: Fix broken UsedPageTableEntries/page table ref counting ASSERTs. The reference
can be UP TO 1024, inclusive, but no more. This might fix a bunch of assertions related to
this. Thanks to Richard for catching this one during his VAD work.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/virtual.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 16:25:43 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/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 16:25:43 2012
@@ -1978,7 +1978,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 +2158,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 +2186,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);
@@ -2209,7 +2209,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
if (SwapEntry != 0)
@@ -2247,7 +2247,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 +2413,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);