From ea50be62a0d8401e13b809aac51aa9fdcb0ad22b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 4 Mar 2012 23:45:16 +0000 Subject: [PATCH] [NEWCC] - Add missing wait entry handling svn path=/trunk/; revision=56022 --- reactos/ntoskrnl/cache/section/fault.c | 12 ++++++++++++ reactos/ntoskrnl/cache/section/swapout.c | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/cache/section/fault.c b/reactos/ntoskrnl/cache/section/fault.c index ad81792de42..5f599cd8207 100644 --- a/reactos/ntoskrnl/cache/section/fault.c +++ b/reactos/ntoskrnl/cache/section/fault.c @@ -158,11 +158,23 @@ MmNotPresentFaultCachePage return Status; } } + else if (MM_IS_WAIT_PTE(Entry)) + { + MmUnlockSectionSegment(Segment); + return STATUS_SUCCESS + 1; + } else if (Entry) { PFN_NUMBER Page = PFN_FROM_SSE(Entry); DPRINT("Take reference to page %x #\n", Page); + if (MiGetPfnEntry(Page) == NULL) + { + DPRINT1("Found no PFN entry for page 0x%x in page entry 0x%x (segment: 0x%p, offset: %08x%08x)\n", + Page, Entry, Segment, TotalOffset.HighPart, TotalOffset.LowPart); + KeBugCheck(CACHE_MANAGER); + } + MmReferencePage(Page); Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1); diff --git a/reactos/ntoskrnl/cache/section/swapout.c b/reactos/ntoskrnl/cache/section/swapout.c index 8de81208097..dd1e86bb187 100644 --- a/reactos/ntoskrnl/cache/section/swapout.c +++ b/reactos/ntoskrnl/cache/section/swapout.c @@ -204,6 +204,12 @@ MmPageOutCacheSection Entry = MmGetPageEntrySectionSegment(Segment, &TotalOffset); + if (MM_IS_WAIT_PTE(Entry)) + { + MmUnlockSectionSegment(Segment); + return STATUS_SUCCESS + 1; + } + 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)); @@ -362,7 +368,7 @@ MmpPageOutPhysicalAddress(PFN_NUMBER Page) if (Status == STATUS_SUCCESS + 1) { // Wait page ... the other guy has it, so we'll just fail for now - DPRINTC("Wait entry ... can't continue\n"); + DPRINT1("Wait entry ... can't continue\n"); Status = STATUS_UNSUCCESSFUL; goto bail; }