Author: arty Date: Sun Feb 19 13:15:33 2012 New Revision: 55712
URL: http://svn.reactos.org/svn/reactos?rev=55712&view=rev Log: [NEWCC] Add a paging out case for cache sections, which had been lost at some point. Recognize the case where the first rmap entry is a segment rmap in pageout. Lock the segment when modifying the segment page table in 1 place.
Modified: branches/arty-newcc/ntoskrnl/mm/rmap.c branches/arty-newcc/ntoskrnl/mm/section.c
Modified: branches/arty-newcc/ntoskrnl/mm/rmap.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/rmap.c?re... ============================================================================== --- branches/arty-newcc/ntoskrnl/mm/rmap.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/mm/rmap.c [iso-8859-1] Sun Feb 19 13:15:33 2012 @@ -58,11 +58,15 @@
ExAcquireFastMutex(&RmapListLock); entry = MmGetRmapListHeadPage(Page); + while (RMAP_IS_SEGMENT(entry->Address)) + entry = entry->Next; + if (entry == NULL) { ExReleaseFastMutex(&RmapListLock); return(STATUS_UNSUCCESSFUL); } + Process = entry->Process;
Address = entry->Address; @@ -140,6 +144,10 @@ */ Status = MmPageOutSectionView(AddressSpace, MemoryArea, Address, PageOp); + } + else if (Type == MEMORY_AREA_CACHE) + { + Status = MmpPageOutPhysicalAddress(Page); } else if (Type == MEMORY_AREA_VIRTUAL_MEMORY) {
Modified: branches/arty-newcc/ntoskrnl/mm/section.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section.c... ============================================================================== --- branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/mm/section.c [iso-8859-1] Sun Feb 19 13:15:33 2012 @@ -2242,8 +2242,13 @@ MmInsertRmap(Page, Process, Address); + // If we got here, the previous entry should have been a wait Entry = MAKE_SSE(Page << PAGE_SHIFT, 1); + MmLockSectionSegment(Context.Segment); + LONG OldEntry = MmGetPageEntrySectionSegment(Context.Segment, &Context.Offset); + ASSERT(OldEntry == 0 || OldEntry == MAKE_SWAP_SSE(MM_WAIT_ENTRY)); MmSetPageEntrySectionSegment(Context.Segment, &Context.Offset, Entry); + MmUnlockSectionSegment(Context.Segment); } MmUnlockAddressSpace(AddressSpace); PageOp->Status = STATUS_UNSUCCESSFUL;