mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:25:41 +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"
|
#include "../newcc.h"
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include "../mm/ARM3/miarm.h"
|
||||||
|
|
||||||
#define DPRINTC DPRINT
|
#define DPRINTC DPRINT
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ LIST_ENTRY MiSegmentList;
|
||||||
|
|
||||||
extern KEVENT MpwThreadEvent;
|
extern KEVENT MpwThreadEvent;
|
||||||
extern KSPIN_LOCK MiSectionPageTableLock;
|
extern KSPIN_LOCK MiSectionPageTableLock;
|
||||||
|
extern PMMWSL MmWorkingSetList;
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
@ -137,9 +139,18 @@ MiZeroFillSection
|
||||||
{
|
{
|
||||||
MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page));
|
MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page));
|
||||||
Address = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart;
|
Address = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart;
|
||||||
|
|
||||||
MmReferencePage(Page);
|
MmReferencePage(Page);
|
||||||
MmCreateVirtualMapping(NULL, Address, PAGE_READWRITE, &Page, 1);
|
MmCreateVirtualMapping(NULL, Address, PAGE_READWRITE, &Page, 1);
|
||||||
MmInsertRmap(Page, NULL, Address);
|
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
|
else
|
||||||
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
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"
|
#include "newmm.h"
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include "../mm/ARM3/miarm.h"
|
||||||
|
|
||||||
#define DPRINTC DPRINT
|
#define DPRINTC DPRINT
|
||||||
|
|
||||||
extern KEVENT MmWaitPageEvent;
|
extern KEVENT MmWaitPageEvent;
|
||||||
|
extern PMMWSL MmWorkingSetList;
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -140,6 +142,14 @@ MmNotPresentFaultCachePage
|
||||||
{
|
{
|
||||||
DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address);
|
DPRINT("Set %x in address space @ %x\n", Required->Page[0], Address);
|
||||||
Status = MmCreateVirtualMapping(Process, Address, Attributes, Required->Page, 1);
|
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))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
MmInsertRmap(Required->Page[0], Process, Address);
|
MmInsertRmap(Required->Page[0], Process, Address);
|
||||||
|
@ -164,6 +174,14 @@ MmNotPresentFaultCachePage
|
||||||
MmReferencePage(Page);
|
MmReferencePage(Page);
|
||||||
|
|
||||||
Status = MmCreateVirtualMapping(Process, Address, Attributes, &Page, 1);
|
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))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
MmInsertRmap(Page, Process, Address);
|
MmInsertRmap(Page, Process, Address);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue