VirtualBox

Changeset 14857 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 1, 2008 1:43:57 PM (16 years ago)
Author:
vboxsync
Message:

PGMR0DynMap: Added missing if (fInvalidateIt) before ASMInvalidatePage in the path main (wopper). Added more statistics.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r14850 r14857  
    15971597
    15981598    /* R0 only: */
    1599     STAM_REG(pVM, &pPGM->StatR0DynMapPage,                  STAMTYPE_COUNTER, "/PGM/R0/DynMapPage" ,                STAMUNIT_OCCURENCES,     "Calls to pgmR0DynMapPage");
    1600     STAM_REG(pVM, &pPGM->StatR0DynMapPageSlow,              STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/Slow" ,           STAMUNIT_OCCURENCES,     "Calls to pgmR0DynMapPageSlow - subtract this from pgmR0DynMapPage to get 1st level hits.");
    1601     STAM_REG(pVM, &pPGM->StatR0DynMapPageSlowLoopHits,      STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/SlowLoopHits" ,   STAMUNIT_OCCURENCES,     "Hits in the loop path.");
    1602     STAM_REG(pVM, &pPGM->StatR0DynMapPageSlowLoopMisses,    STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/SlowLoopMisses",  STAMUNIT_OCCURENCES,     "Misses in the loop path. NonLoopMisses = Slow - SlowLoopHit - SlowLoopMisses");
    16031599    STAM_REG(pVM, &pPGM->StatR0DynMapHCPage,                STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/HCPage",          STAMUNIT_OCCURENCES,     "Calls to PGMDynMapHCPage (ring-0).");
    16041600    STAM_REG(pVM, &pPGM->StatR0DynMapHCPageSetOptimize,     STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/HCPageSetOptimize", STAMUNIT_OCCURENCES,   "Calls to pgmDynMapOptimizeAutoSet.");
    16051601    STAM_REG(pVM, &pPGM->StatR0DynMapHCPageSetSearchHits,   STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/HCPageSetSearchHits", STAMUNIT_OCCURENCES, "Set search hits.");
    16061602    STAM_REG(pVM, &pPGM->StatR0DynMapHCPageSetSearchMisses, STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/HCPageSetSearchMisses", STAMUNIT_OCCURENCES, "Set search misses.");
     1603    STAM_REG(pVM, &pPGM->StatR0DynMapMigrateInvlPg,         STAMTYPE_COUNTER, "/PGM/R0/DynMapMigrateInvlPg",        STAMUNIT_OCCURENCES,     "invlpg count in PGMDynMapMigrateAutoSet.");
     1604    STAM_REG(pVM, &pPGM->StatR0DynMapPage,                  STAMTYPE_COUNTER, "/PGM/R0/DynMapPage",                 STAMUNIT_OCCURENCES,     "Calls to pgmR0DynMapPage");
     1605    STAM_REG(pVM, &pPGM->StatR0DynMapPageInvlPg,            STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/InvlPg",          STAMUNIT_OCCURENCES,     "invlpg count in pgmR0DynMapPageSlow.");
     1606    STAM_REG(pVM, &pPGM->StatR0DynMapPageSlow,              STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/Slow",            STAMUNIT_OCCURENCES,     "Calls to pgmR0DynMapPageSlow - subtract this from pgmR0DynMapPage to get 1st level hits.");
     1607    STAM_REG(pVM, &pPGM->StatR0DynMapPageSlowLoopHits,      STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/SlowLoopHits" ,   STAMUNIT_OCCURENCES,     "Hits in the loop path.");
     1608    STAM_REG(pVM, &pPGM->StatR0DynMapPageSlowLoopMisses,    STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/SlowLoopMisses",  STAMUNIT_OCCURENCES,     "Misses in the loop path. NonLoopMisses = Slow - SlowLoopHit - SlowLoopMisses");
     1609    STAM_REG(pVM, &pPGM->StatR0DynMapPageSlowLostHits,      STAMTYPE_COUNTER, "/PGM/R0/DynMapPage/SlowLostHits",    STAMUNIT_OCCURENCES,     "Lost hits.");
    16071610
    16081611    /* GC only: */
  • trunk/src/VBox/VMM/PGMInternal.h

    r14850 r14857  
    25612561
    25622562    /* R0 only: */
    2563     STAMCOUNTER StatR0DynMapPage;                   /**< R0: Calls to pgmR0DynMapPage. */
    2564     STAMCOUNTER StatR0DynMapPageSlow;               /**< R0: Calls to pgmR0DynMapPageSlow. */
    2565     STAMCOUNTER StatR0DynMapPageSlowLoopHits;       /**< R0: Hits in the pgmR0DynMapPageSlow search loop. */
    2566     STAMCOUNTER StatR0DynMapPageSlowLoopMisses;     /**< R0: Misses in the pgmR0DynMapPageSlow search loop. */
    25672563    STAMCOUNTER StatR0DynMapHCPage;                 /**< R0: Calls to PGMDynMapHCPage. */
    25682564    STAMCOUNTER StatR0DynMapHCPageSetOptimize;      /**< R0: Calls to pgmDynMapOptimizeAutoSet. */
    25692565    STAMCOUNTER StatR0DynMapHCPageSetSearchHits;    /**< R0: Set search hits. */
    25702566    STAMCOUNTER StatR0DynMapHCPageSetSearchMisses;  /**< R0: Set search misses. */
     2567    STAMCOUNTER StatR0DynMapMigrateInvlPg;          /**< R0: invlpg in PGMDynMapMigrateAutoSet. */
     2568    STAMCOUNTER StatR0DynMapPage;                   /**< R0: Calls to pgmR0DynMapPage. */
     2569    STAMCOUNTER StatR0DynMapPageInvlPg;             /**< R0: invlpg. */
     2570    STAMCOUNTER StatR0DynMapPageSlow;               /**< R0: Calls to pgmR0DynMapPageSlow. */
     2571    STAMCOUNTER StatR0DynMapPageSlowLoopHits;       /**< R0: Hits in the pgmR0DynMapPageSlow search loop. */
     2572    STAMCOUNTER StatR0DynMapPageSlowLoopMisses;     /**< R0: Misses in the pgmR0DynMapPageSlow search loop. */
     2573    STAMCOUNTER StatR0DynMapPageSlowLostHits;       /**< R0: Lost hits. */
    25712574
    25722575    /* RC only: */
  • trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp

    r14853 r14857  
    11771177     * already has made sure they aren't matching.
    11781178     */
     1179#ifdef VBOX_WITH_STATISTICS
     1180    bool                fLooped = false;
     1181#endif
    11791182    uint32_t const      cPages  = pThis->cPages;
    11801183    PPGMR0DYNMAPENTRY   paPages = pThis->paPages;
     
    12121215        }
    12131216        STAM_COUNTER_INC(&pVM->pgm.s.StatR0DynMapPageSlowLoopMisses);
     1217#ifdef VBOX_WITH_STATISTICS
     1218        fLooped = true;
     1219#endif
    12141220    }
    12151221    Assert(iFreePage < cPages);
     1222
     1223#ifdef VBOX_WITH_STATISTICS
     1224    /* Check for lost hits. */
     1225    if (!fLooped)
     1226        for (uint32_t iPage2 = (iPage + 5) % cPages; iPage2 != iPage; iPage2 = (iPage2 + 1) % cPages)
     1227            if (paPages[iPage2].HCPhys == HCPhys)
     1228                STAM_COUNTER_INC(&pVM->pgm.s.StatR0DynMapPageSlowLostHits);
     1229#endif
    12161230
    12171231    /*
     
    13411355     * Do the actual invalidation outside the spinlock.
    13421356     */
    1343     ASMInvalidatePage(pvPage);
     1357    if (fInvalidateIt)
     1358    {
     1359        STAM_COUNTER_INC(&pVM->pgm.s.StatR0DynMapPageInvlPg);
     1360        ASMInvalidatePage(pvPage);
     1361    }
    13441362
    13451363    *ppvPage = pvPage;
     
    15711589                    RTCpuSetDel(&pThis->paPages[iPage].PendingSet, idRealCpu);
    15721590                    ASMInvalidatePage(pThis->paPages[iPage].pvPage);
     1591                    STAM_COUNTER_INC(&pVCpu->pVMR0->pgm.s.StatR0DynMapMigrateInvlPg);
    15731592                }
    15741593            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette