mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[NTOS:MM] Fix another instance of reentrant spinlock acquisition
This commit is contained in:
parent
31322f5df9
commit
91587a432b
13
ntoskrnl/cache/newcc.h
vendored
13
ntoskrnl/cache/newcc.h
vendored
@ -160,3 +160,16 @@ CcpPinMappedData(IN PNOCC_CACHE_MAP Map,
|
||||
IN ULONG Length,
|
||||
IN ULONG Flags,
|
||||
IN OUT PVOID *Bcb);
|
||||
|
||||
ULONG
|
||||
MmGetReferenceCountPageWithoutLock(PFN_NUMBER Page)
|
||||
{
|
||||
ULONG Ret;
|
||||
KIRQL OldIrql = MiAcquirePfnLock();
|
||||
|
||||
Ret = MmGetReferenceCountPage(Page);
|
||||
|
||||
MiReleasePfnLock(OldIrql);
|
||||
|
||||
return Ret;
|
||||
}
|
||||
|
2
ntoskrnl/cache/section/data.c
vendored
2
ntoskrnl/cache/section/data.c
vendored
@ -643,7 +643,7 @@ MiFreeSegmentPage(PMM_SECTION_SEGMENT Segment,
|
||||
OldPage,
|
||||
FileOffset->QuadPart,
|
||||
Segment,
|
||||
MmGetReferenceCountPage(OldPage),
|
||||
MmGetReferenceCountPageWithoutLock(OldPage),
|
||||
Entry,
|
||||
IS_DIRTY_SSE(Entry) ? "true" : "false");
|
||||
|
||||
|
6
ntoskrnl/cache/section/swapout.c
vendored
6
ntoskrnl/cache/section/swapout.c
vendored
@ -172,11 +172,11 @@ MmFinalizeSectionPageOut(PMM_SECTION_SEGMENT Segment,
|
||||
SWAPENTRY Swap = MmGetSavedSwapEntryPage(Page);
|
||||
|
||||
/* Bail early if the reference count isn't where we need it */
|
||||
if (MmGetReferenceCountPage(Page) != 1)
|
||||
if (MmGetReferenceCountPageWithoutLock(Page) != 1)
|
||||
{
|
||||
DPRINT1("Cannot page out locked page %x with ref count %lu\n",
|
||||
Page,
|
||||
MmGetReferenceCountPage(Page));
|
||||
MmGetReferenceCountPageWithoutLock(Page));
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
@ -357,7 +357,7 @@ MmpPageOutPhysicalAddress(PFN_NUMBER Page)
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
MM_REQUIRED_RESOURCES Resources = { 0 };
|
||||
|
||||
DPRINTC("Page out %x (ref ct %x)\n", Page, MmGetReferenceCountPage(Page));
|
||||
DPRINTC("Page out %x (ref ct %x)\n", Page, MmGetReferenceCountPageWithoutLock(Page));
|
||||
|
||||
ExAcquireFastMutex(&MiGlobalPageOperation);
|
||||
if ((Segment = MmGetSectionAssociation(Page, &FileOffset)))
|
||||
|
@ -537,20 +537,19 @@ ULONG
|
||||
NTAPI
|
||||
MmGetReferenceCountPage(PFN_NUMBER Pfn)
|
||||
{
|
||||
KIRQL oldIrql;
|
||||
ULONG RCount;
|
||||
PMMPFN Pfn1;
|
||||
|
||||
MI_ASSERT_PFN_LOCK_HELD();
|
||||
|
||||
DPRINT("MmGetReferenceCountPage(PhysicalAddress %x)\n", Pfn << PAGE_SHIFT);
|
||||
|
||||
oldIrql = MiAcquirePfnLock();
|
||||
Pfn1 = MiGetPfnEntry(Pfn);
|
||||
ASSERT(Pfn1);
|
||||
ASSERT_IS_ROS_PFN(Pfn1);
|
||||
|
||||
RCount = Pfn1->u3.e2.ReferenceCount;
|
||||
|
||||
MiReleasePfnLock(oldIrql);
|
||||
return(RCount);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user