mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:52:56 +00:00
[NTOSKRNL]
- Change MmDereferencePage to MmReleasePageMemoryConsumer to do proper page usage tracking - Remove an unnecessary reference and dereference svn path=/trunk/; revision=55897
This commit is contained in:
parent
3998099eae
commit
24264b8dc2
2 changed files with 4 additions and 7 deletions
2
reactos/ntoskrnl/cache/section/data.c
vendored
2
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -278,7 +278,7 @@ _MiFlushMappedSection
|
||||||
&Segment->FileObject->FileName,
|
&Segment->FileObject->FileName,
|
||||||
Status);
|
Status);
|
||||||
}
|
}
|
||||||
MmDereferencePage(Page);
|
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
9
reactos/ntoskrnl/cache/section/swapout.c
vendored
9
reactos/ntoskrnl/cache/section/swapout.c
vendored
|
@ -157,11 +157,10 @@ MmFinalizeSectionPageOut
|
||||||
{
|
{
|
||||||
DPRINT("Removing page %x for real\n", Page);
|
DPRINT("Removing page %x for real\n", Page);
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
MmSetSavedSwapEntryPage(Page, 0);
|
||||||
// Note: the other one is held by MmTrimUserMemory
|
if (MmGetReferenceCountPage(Page) != 1) {
|
||||||
if (MmGetReferenceCountPage(Page) != 2) {
|
|
||||||
DPRINT1("ALERT: Page %x about to be evicted with ref count %d\n", Page, MmGetReferenceCountPage(Page));
|
DPRINT1("ALERT: Page %x about to be evicted with ref count %d\n", Page, MmGetReferenceCountPage(Page));
|
||||||
}
|
}
|
||||||
MmDereferencePage(Page);
|
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
||||||
}
|
}
|
||||||
|
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
|
@ -216,7 +215,7 @@ MmPageOutCacheSection
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
MmDereferencePage(Required->Page[0]);
|
MmReleasePageMemoryConsumer(MC_CACHE, Required->Page[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
|
@ -461,13 +460,11 @@ MiCacheEvictPages(PMM_SECTION_SEGMENT Segment, ULONG Target)
|
||||||
Entry = MmGetPageEntrySectionSegment(Segment, &Offset);
|
Entry = MmGetPageEntrySectionSegment(Segment, &Offset);
|
||||||
if (Entry && !IS_SWAP_FROM_SSE(Entry)) {
|
if (Entry && !IS_SWAP_FROM_SSE(Entry)) {
|
||||||
Page = PFN_FROM_SSE(Entry);
|
Page = PFN_FROM_SSE(Entry);
|
||||||
MmReferencePage(Page);
|
|
||||||
MmUnlockSectionSegment(Segment);
|
MmUnlockSectionSegment(Segment);
|
||||||
Status = MmpPageOutPhysicalAddress(Page);
|
Status = MmpPageOutPhysicalAddress(Page);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
Result++;
|
Result++;
|
||||||
MmLockSectionSegment(Segment);
|
MmLockSectionSegment(Segment);
|
||||||
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue