mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:02:59 +00:00
[NTOSKRNL]
- Fix PDE reference counting - Now only the recursive fault remains as an issue in the page out path svn path=/trunk/; revision=55898
This commit is contained in:
parent
24264b8dc2
commit
72a7d22233
3 changed files with 21 additions and 17 deletions
4
reactos/ntoskrnl/cache/section/data.c
vendored
4
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -676,6 +676,10 @@ MmFreeCacheSectionPage
|
||||||
MmDeleteRmap(Page, Process, Address);
|
MmDeleteRmap(Page, Process, Address);
|
||||||
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
|
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
|
||||||
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
||||||
|
#if (_MI_PAGING_LEVELS == 2)
|
||||||
|
if (Address < MmSystemRangeStart)
|
||||||
|
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]--;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (SwapEntry != 0)
|
if (SwapEntry != 0)
|
||||||
{
|
{
|
||||||
|
|
14
reactos/ntoskrnl/cache/section/fault.c
vendored
14
reactos/ntoskrnl/cache/section/fault.c
vendored
|
@ -143,11 +143,10 @@ MmNotPresentFaultCachePage
|
||||||
DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address);
|
DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address);
|
||||||
Status = MmCreateVirtualMapping(Process, Address, Attributes, Required->Page, 1);
|
Status = MmCreateVirtualMapping(Process, Address, Attributes, Required->Page, 1);
|
||||||
#if (_MI_PAGING_LEVELS == 2)
|
#if (_MI_PAGING_LEVELS == 2)
|
||||||
/* Reference Page Directory Entry */
|
if (Address < MmSystemRangeStart)
|
||||||
if(Address < MmSystemRangeStart)
|
|
||||||
{
|
{
|
||||||
MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
|
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
|
||||||
ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
|
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
@ -175,11 +174,10 @@ MmNotPresentFaultCachePage
|
||||||
|
|
||||||
Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1);
|
Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1);
|
||||||
#if (_MI_PAGING_LEVELS == 2)
|
#if (_MI_PAGING_LEVELS == 2)
|
||||||
/* Reference Page Directory Entry */
|
if (Address < MmSystemRangeStart)
|
||||||
if(Address < MmSystemRangeStart)
|
|
||||||
{
|
{
|
||||||
MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
|
Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++;
|
||||||
ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
|
ASSERT(Process->Vm.VmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
|
14
reactos/ntoskrnl/cache/section/swapout.c
vendored
14
reactos/ntoskrnl/cache/section/swapout.c
vendored
|
@ -54,6 +54,7 @@
|
||||||
|
|
||||||
extern KEVENT MmWaitPageEvent;
|
extern KEVENT MmWaitPageEvent;
|
||||||
extern FAST_MUTEX RmapListLock;
|
extern FAST_MUTEX RmapListLock;
|
||||||
|
extern PMMWSL MmWorkingSetList;
|
||||||
|
|
||||||
FAST_MUTEX MiGlobalPageOperation;
|
FAST_MUTEX MiGlobalPageOperation;
|
||||||
|
|
||||||
|
@ -186,7 +187,6 @@ MmPageOutCacheSection
|
||||||
BOOLEAN Dirty,
|
BOOLEAN Dirty,
|
||||||
PMM_REQUIRED_RESOURCES Required)
|
PMM_REQUIRED_RESOURCES Required)
|
||||||
{
|
{
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
ULONG Entry;
|
ULONG Entry;
|
||||||
PFN_NUMBER OurPage;
|
PFN_NUMBER OurPage;
|
||||||
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
|
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
|
||||||
|
@ -213,14 +213,16 @@ MmPageOutCacheSection
|
||||||
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, &OurPage);
|
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, &OurPage);
|
||||||
ASSERT(OurPage == Required->Page[0]);
|
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);
|
MmUnlockSectionSegment(Segment);
|
||||||
MiSetPageEvent(Process, Address);
|
MiSetPageEvent(Process, Address);
|
||||||
return Status;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue