mirror of
https://github.com/reactos/reactos.git
synced 2025-06-29 18:31:22 +00:00
[NEWCC]
Fix paging out. - We know we're in a wait entry in the section. What we really want to know is if it's safe to evict this address space when withdrawing the mappings. - We don't want to corrupt our wait entry in the section page table to keep accumulating dirty state into the page out process until it's time to finally evict. svn path=/trunk/; revision=56024
This commit is contained in:
parent
1490d48263
commit
4d698f45aa
1 changed files with 10 additions and 11 deletions
21
reactos/ntoskrnl/cache/section/swapout.c
vendored
21
reactos/ntoskrnl/cache/section/swapout.c
vendored
|
@ -184,7 +184,7 @@ MmPageOutCacheSection
|
||||||
(PMMSUPPORT AddressSpace,
|
(PMMSUPPORT AddressSpace,
|
||||||
MEMORY_AREA* MemoryArea,
|
MEMORY_AREA* MemoryArea,
|
||||||
PVOID Address,
|
PVOID Address,
|
||||||
BOOLEAN Dirty,
|
PBOOLEAN Dirty,
|
||||||
PMM_REQUIRED_RESOURCES Required)
|
PMM_REQUIRED_RESOURCES Required)
|
||||||
{
|
{
|
||||||
ULONG Entry;
|
ULONG Entry;
|
||||||
|
@ -204,19 +204,16 @@ MmPageOutCacheSection
|
||||||
|
|
||||||
Entry = MmGetPageEntrySectionSegment(Segment, &TotalOffset);
|
Entry = MmGetPageEntrySectionSegment(Segment, &TotalOffset);
|
||||||
|
|
||||||
if (MM_IS_WAIT_PTE(Entry))
|
if (MmIsPageSwapEntry(Process, PAddress))
|
||||||
{
|
{
|
||||||
|
SWAPENTRY SwapEntry;
|
||||||
|
MmGetPageFileMapping(Process, PAddress, &SwapEntry);
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
return STATUS_SUCCESS + 1;
|
return SwapEntry == MM_WAIT_ENTRY ? STATUS_SUCCESS + 1 : STATUS_UNSUCCESSFUL;
|
||||||
}
|
|
||||||
|
|
||||||
if (Dirty) {
|
|
||||||
DPRINT("Dirty page: %p:%p segment %p offset %08x%08x\n", Process, Address, Segment, TotalOffset.HighPart, TotalOffset.LowPart);
|
|
||||||
MmSetPageEntrySectionSegment(Segment, &TotalOffset, DIRTY_SSE(Entry));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MmDeleteRmap(Required->Page[0], Process, Address);
|
MmDeleteRmap(Required->Page[0], Process, Address);
|
||||||
MmDeleteVirtualMapping(Process, Address, FALSE, NULL, &OurPage);
|
MmDeleteVirtualMapping(Process, Address, FALSE, Dirty, &OurPage);
|
||||||
ASSERT(OurPage == Required->Page[0]);
|
ASSERT(OurPage == Required->Page[0]);
|
||||||
|
|
||||||
MmReleasePageMemoryConsumer(MC_CACHE, Required->Page[0]);
|
MmReleasePageMemoryConsumer(MC_CACHE, Required->Page[0]);
|
||||||
|
@ -230,7 +227,7 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmpPageOutPhysicalAddress(PFN_NUMBER Page)
|
MmpPageOutPhysicalAddress(PFN_NUMBER Page)
|
||||||
{
|
{
|
||||||
BOOLEAN ProcRef = FALSE;
|
BOOLEAN ProcRef = FALSE, PageDirty;
|
||||||
PFN_NUMBER SectionPage = 0;
|
PFN_NUMBER SectionPage = 0;
|
||||||
PMM_RMAP_ENTRY entry;
|
PMM_RMAP_ENTRY entry;
|
||||||
PMM_SECTION_SEGMENT Segment = NULL;
|
PMM_SECTION_SEGMENT Segment = NULL;
|
||||||
|
@ -357,8 +354,10 @@ MmpPageOutPhysicalAddress(PFN_NUMBER Page)
|
||||||
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
||||||
|
|
||||||
DPRINT("%x:%x, page %x %x\n", Process, Address, Page, Resources.Page[0]);
|
DPRINT("%x:%x, page %x %x\n", Process, Address, Page, Resources.Page[0]);
|
||||||
|
PageDirty = FALSE;
|
||||||
Status = MmPageOutCacheSection
|
Status = MmPageOutCacheSection
|
||||||
(AddressSpace, MemoryArea, Address, Dirty, &Resources);
|
(AddressSpace, MemoryArea, Address, &PageDirty, &Resources);
|
||||||
|
Dirty |= PageDirty;
|
||||||
DPRINT("%x\n", Status);
|
DPRINT("%x\n", Status);
|
||||||
|
|
||||||
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
ASSERT(KeGetCurrentIrql() <= APC_LEVEL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue