mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 05:22:59 +00:00
[NEWCC]
Update used page table entry counts when mapping pages in cache sections. svn path=/trunk/; revision=55837
This commit is contained in:
parent
34136e69cf
commit
3e19b0bab3
2 changed files with 29 additions and 0 deletions
11
reactos/ntoskrnl/cache/section/data.c
vendored
11
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -49,6 +49,7 @@
|
|||
#include "../newcc.h"
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
#include "../mm/ARM3/miarm.h"
|
||||
|
||||
#define DPRINTC DPRINT
|
||||
|
||||
|
@ -56,6 +57,7 @@ LIST_ENTRY MiSegmentList;
|
|||
|
||||
extern KEVENT MpwThreadEvent;
|
||||
extern KSPIN_LOCK MiSectionPageTableLock;
|
||||
extern PMMWSL MmWorkingSetList;
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
|
@ -137,9 +139,18 @@ MiZeroFillSection
|
|||
{
|
||||
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);
|
||||
|
|
18
reactos/ntoskrnl/cache/section/fault.c
vendored
18
reactos/ntoskrnl/cache/section/fault.c
vendored
|
@ -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 @@ MmNotPresentFaultCachePage
|
|||
{
|
||||
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 @@ MmNotPresentFaultCachePage
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue