Author: arty Date: Fri Feb 24 10:05:06 2012 New Revision: 55837
URL: http://svn.reactos.org/svn/reactos?rev=55837&view=rev Log: [NEWCC] Update used page table entry counts when mapping pages in cache sections.
Modified: trunk/reactos/ntoskrnl/cache/section/data.c trunk/reactos/ntoskrnl/cache/section/fault.c
Modified: trunk/reactos/ntoskrnl/cache/section/data.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/data... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Fri Feb 24 10:05:06 2012 @@ -49,6 +49,7 @@ #include "../newcc.h" #define NDEBUG #include <debug.h> +#include "../mm/ARM3/miarm.h"
#define DPRINTC DPRINT
@@ -56,6 +57,7 @@
extern KEVENT MpwThreadEvent; extern KSPIN_LOCK MiSectionPageTableLock; +extern PMMWSL MmWorkingSetList;
/* GLOBALS *******************************************************************/
@@ -137,9 +139,18 @@ { MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page)); Address = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart; + MmReferencePage(Page); MmCreateVirtualMapping(NULL, Address, PAGE_READWRITE, &Page, 1); MmInsertRmap(Page, NULL, Address); +#if (_MI_PAGING_LEVELS == 2) + /* Reference Page Directory Entry */ + if(Address < MmSystemRangeStart) + { + MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++; + ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT); + } +#endif } else MmReleasePageMemoryConsumer(MC_CACHE, Page);
Modified: trunk/reactos/ntoskrnl/cache/section/fault.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/faul... ============================================================================== --- trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/section/fault.c [iso-8859-1] Fri Feb 24 10:05:06 2012 @@ -49,10 +49,12 @@ #include "newmm.h" #define NDEBUG #include <debug.h> +#include "../mm/ARM3/miarm.h"
#define DPRINTC DPRINT
extern KEVENT MmWaitPageEvent; +extern PMMWSL MmWorkingSetList;
NTSTATUS NTAPI @@ -140,6 +142,14 @@ { DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address); Status = MmCreateVirtualMapping(Process, Address, Attributes, Required->Page, 1); +#if (_MI_PAGING_LEVELS == 2) + /* Reference Page Directory Entry */ + if(Address < MmSystemRangeStart) + { + MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++; + ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT); + } +#endif if (NT_SUCCESS(Status)) { MmInsertRmap(Required->Page[0], Process, Address); @@ -164,6 +174,14 @@ MmReferencePage(Page);
Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1); +#if (_MI_PAGING_LEVELS == 2) + /* Reference Page Directory Entry */ + if(Address < MmSystemRangeStart) + { + MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)]++; + ASSERT(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] <= PTE_COUNT); + } +#endif if (NT_SUCCESS(Status)) { MmInsertRmap(Page, Process, Address);