mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 05:32:55 +00:00
[NEWCC]
- Don't allow a locked page to be paged out svn path=/trunk/; revision=56047
This commit is contained in:
parent
76f7011ac8
commit
18a6ac6ae4
1 changed files with 7 additions and 3 deletions
10
reactos/ntoskrnl/cache/section/swapout.c
vendored
10
reactos/ntoskrnl/cache/section/swapout.c
vendored
|
@ -113,6 +113,13 @@ MmFinalizeSectionPageOut
|
||||||
BOOLEAN WriteZero = FALSE, WritePage = FALSE;
|
BOOLEAN WriteZero = FALSE, WritePage = FALSE;
|
||||||
SWAPENTRY Swap = MmGetSavedSwapEntryPage(Page);
|
SWAPENTRY Swap = MmGetSavedSwapEntryPage(Page);
|
||||||
|
|
||||||
|
/* Bail early if the reference count isn't where we need it */
|
||||||
|
if (MmGetReferenceCountPage(Page) != 1)
|
||||||
|
{
|
||||||
|
DPRINT1("Cannot page out locked page %x with ref count %d\n", Page, MmGetReferenceCountPage(Page));
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
|
||||||
MmLockSectionSegment(Segment);
|
MmLockSectionSegment(Segment);
|
||||||
(void)InterlockedIncrementUL(&Segment->ReferenceCount);
|
(void)InterlockedIncrementUL(&Segment->ReferenceCount);
|
||||||
|
|
||||||
|
@ -158,9 +165,6 @@ MmFinalizeSectionPageOut
|
||||||
{
|
{
|
||||||
DPRINT("Removing page %x for real\n", Page);
|
DPRINT("Removing page %x for real\n", Page);
|
||||||
MmSetSavedSwapEntryPage(Page, 0);
|
MmSetSavedSwapEntryPage(Page, 0);
|
||||||
if (MmGetReferenceCountPage(Page) != 1) {
|
|
||||||
DPRINT1("ALERT: Page %x about to be evicted with ref count %d\n", Page, MmGetReferenceCountPage(Page));
|
|
||||||
}
|
|
||||||
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
MmReleasePageMemoryConsumer(MC_CACHE, Page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue