mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOSKRNL]
- Don't page out locked pages - Fixes random failed assertions in MmUnlockPages svn path=/trunk/; revision=54648
This commit is contained in:
parent
f4065b5b2a
commit
c6b88aa125
2 changed files with 26 additions and 0 deletions
|
@ -75,6 +75,20 @@ MmPageOutVirtualMemory(PMMSUPPORT AddressSpace,
|
|||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check the reference count to ensure this page can be paged out
|
||||
*/
|
||||
Page = MmGetPfnForProcess(Process, Address);
|
||||
if (MmGetReferenceCountPage(Page) != 1)
|
||||
{
|
||||
DPRINT1("Cannot page out locked virtual memory page: 0x%p (RefCount: %d)\n",
|
||||
Page, MmGetReferenceCountPage(Page));
|
||||
PageOp->Status = STATUS_UNSUCCESSFUL;
|
||||
KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
|
||||
MmReleasePageOp(PageOp);
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Disable the virtual mapping.
|
||||
*/
|
||||
|
|
|
@ -2106,6 +2106,18 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace,
|
|||
Page = MmGetPfnForProcess(Process, Address);
|
||||
SwapEntry = MmGetSavedSwapEntryPage(Page);
|
||||
|
||||
/*
|
||||
* Check the reference count to ensure this page can be paged out
|
||||
*/
|
||||
if (MmGetReferenceCountPage(Page) != 1)
|
||||
{
|
||||
DPRINT1("Cannot page out locked section page: 0x%p (RefCount: %d)\n",
|
||||
Page, MmGetReferenceCountPage(Page));
|
||||
PageOp->Status = STATUS_UNSUCCESSFUL;
|
||||
MmspCompleteAndReleasePageOp(PageOp);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prepare the context structure for the rmap delete call.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue