[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.

svn path=/trunk/; revision=55921
This commit is contained in:
Alex Ionescu 2012-02-29 16:25:43 +00:00
parent d485558f04
commit 1401fbea9b
2 changed files with 7 additions and 7 deletions

View file

@ -412,7 +412,7 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
{
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 */

View file

@ -1978,7 +1978,7 @@ MmPageOutDeleteMapping(PVOID Context, PEPROCESS Process, PVOID Address)
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 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
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 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
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 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
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 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
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 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
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);