https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8bfba59b3eaabdffd8cafbb87b5492f77b17605e

commit 8bfba59b3eaabdffd8cafbb87b5492f77b17605e
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Wed May 26 10:20:57 2021 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Jun 9 11:27:18 2021 +0200

    [NTOS:MM] Add some DPRINTs when incrementing or decrementing PFN share count
---
 ntoskrnl/mm/ARM3/pfnlist.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ntoskrnl/mm/ARM3/pfnlist.c b/ntoskrnl/mm/ARM3/pfnlist.c
index a75f2194396..b9838f29602 100644
--- a/ntoskrnl/mm/ARM3/pfnlist.c
+++ b/ntoskrnl/mm/ARM3/pfnlist.c
@@ -978,6 +978,8 @@ MiInitializePfn(IN PFN_NUMBER PageFrameIndex,
     Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
     Pfn1->PteAddress = PointerPte;
 
+    DPRINT("Called for %p from %p\n", Pfn1, _ReturnAddress());
+
     /* Check if this PFN is part of a valid address space */
     if (PointerPte->u.Hard.Valid == 1)
     {
@@ -1049,6 +1051,8 @@ MiInitializePfnAndMakePteValid(IN PFN_NUMBER 
PageFrameIndex,
     Pfn1->PteAddress = PointerPte;
     Pfn1->OriginalPte = DemandZeroPte;
 
+    DPRINT("Incrementing %p from %p\n", Pfn1, _ReturnAddress());
+
     /* Otherwise this is a fresh page -- set it up */
     ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
     Pfn1->u3.e2.ReferenceCount++;
@@ -1082,6 +1086,7 @@ MiInitializePfnAndMakePteValid(IN PFN_NUMBER 
PageFrameIndex,
     /* Increase its share count so we don't get rid of it */
     Pfn1 = MI_PFN_ELEMENT(PageFrameIndex);
     Pfn1->u2.ShareCount++;
+    DPRINT("Incrementing %p from %p\n", Pfn1, _ReturnAddress());
 
     /* Write valid PTE */
     MI_WRITE_VALID_PTE(PointerPte, TempPte);
@@ -1140,6 +1145,8 @@ MiDecrementShareCount(IN PMMPFN Pfn1,
     ASSERT(Pfn1 == MI_PFN_ELEMENT(PageFrameIndex));
     ASSERT(MI_IS_ROS_PFN(Pfn1) == FALSE);
 
+    DPRINT("Decrementing %p from %p\n", Pfn1, _ReturnAddress());
+
     /* Page must be in-use */
     if ((Pfn1->u3.e1.PageLocation != ActiveAndValid) &&
         (Pfn1->u3.e1.PageLocation != StandbyPageList))
@@ -1289,6 +1296,8 @@ MiInitializePfnForOtherProcess(IN PFN_NUMBER 
PageFrameIndex,
     /* Make this a software PTE */
     MI_MAKE_SOFTWARE_PTE(&Pfn1->OriginalPte, MM_READWRITE);
 
+    DPRINT("Called for %p from %p\n", Pfn1, _ReturnAddress());
+
     /* Setup the page */
     ASSERT(Pfn1->u3.e2.ReferenceCount == 0);
     Pfn1->u3.e2.ReferenceCount = 1;
@@ -1305,6 +1314,8 @@ MiInitializePfnForOtherProcess(IN PFN_NUMBER 
PageFrameIndex,
 
         /* Increase its share count so we don't get rid of it */
         Pfn1 = MI_PFN_ELEMENT(PteFrame);
+
+        DPRINT("Incrementing %p from %p\n", Pfn1, _ReturnAddress());
         Pfn1->u2.ShareCount++;
     }
 }

Reply via email to