VirtualBox

Changeset 15436 in vbox for trunk/src


Ignore:
Timestamp:
Dec 13, 2008 11:59:30 AM (16 years ago)
Author:
vboxsync
Message:

PGMR0DynMap: Corrected PGMR0DYNMAP_PAGES_PER_CPU_MIN (>= max set size). Added set size stats.

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

Legend:

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

    r15414 r15436  
    16231623    STAM_REG(pVM, &pPGM->StatR0DynMapSubsets,               STAMTYPE_COUNTER, "/PGM/R0/Subsets",                    STAMUNIT_OCCURENCES,     "Times PGMDynMapPushAutoSubset was called.");
    16241624    STAM_REG(pVM, &pPGM->StatR0DynMapPopFlushes,            STAMTYPE_COUNTER, "/PGM/R0/SubsetPopFlushes",           STAMUNIT_OCCURENCES,     "Times PGMDynMapPopAutoSubset flushes the subset.");
     1625    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[0],           STAMTYPE_COUNTER, "/PGM/R0/SetSize000..09",              STAMUNIT_OCCURENCES,    "00-09% filled");
     1626    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[1],           STAMTYPE_COUNTER, "/PGM/R0/SetSize010..19",              STAMUNIT_OCCURENCES,    "10-19% filled");
     1627    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[2],           STAMTYPE_COUNTER, "/PGM/R0/SetSize020..29",              STAMUNIT_OCCURENCES,    "20-29% filled");
     1628    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[3],           STAMTYPE_COUNTER, "/PGM/R0/SetSize030..39",              STAMUNIT_OCCURENCES,    "30-39% filled");
     1629    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[4],           STAMTYPE_COUNTER, "/PGM/R0/SetSize040..49",              STAMUNIT_OCCURENCES,    "40-49% filled");
     1630    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[5],           STAMTYPE_COUNTER, "/PGM/R0/SetSize050..59",              STAMUNIT_OCCURENCES,    "50-59% filled");
     1631    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[6],           STAMTYPE_COUNTER, "/PGM/R0/SetSize060..69",              STAMUNIT_OCCURENCES,    "60-69% filled");
     1632    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[7],           STAMTYPE_COUNTER, "/PGM/R0/SetSize070..79",              STAMUNIT_OCCURENCES,    "70-79% filled");
     1633    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[8],           STAMTYPE_COUNTER, "/PGM/R0/SetSize080..89",              STAMUNIT_OCCURENCES,    "80-89% filled");
     1634    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[9],           STAMTYPE_COUNTER, "/PGM/R0/SetSize090..99",              STAMUNIT_OCCURENCES,    "90-99% filled");
     1635    STAM_REG(pVM, &pPGM->aStatR0DynMapSetSize[10],          STAMTYPE_COUNTER, "/PGM/R0/SetSize100",                 STAMUNIT_OCCURENCES,     "100% filled");
    16251636
    16261637    /* GC only: */
  • trunk/src/VBox/VMM/PGMInternal.h

    r15434 r15436  
    26842684    STAMCOUNTER StatR0DynMapSubsets;                /**< R0: Times PGMDynMapPushAutoSubset was called. */
    26852685    STAMCOUNTER StatR0DynMapPopFlushes;             /**< R0: Times PGMDynMapPopAutoSubset flushes the subset. */
     2686    STAMCOUNTER aStatR0DynMapSetSize[11];           /**< R0: Set size distribution. */
    26862687
    26872688    /* RC only: */
  • trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp

    r15434 r15436  
    5252/** The minimum number of pages we reserve per CPU.
    5353 * This must be equal or larger than the autoset size.  */
    54 #define PGMR0DYNMAP_PAGES_PER_CPU_MIN       32
     54#define PGMR0DYNMAP_PAGES_PER_CPU_MIN       64
    5555/** The number of guard pages.
    5656 * @remarks Never do tuning of the hashing or whatnot with a strict build!  */
     
    15661566    pSet->iCpu = -1;
    15671567
     1568    STAM_COUNTER_INC(&pVCpu->pVMR0->pgm.s.aStatR0DynMapSetSize[(cEntries * 10 / RT_ELEMENTS(pSet->aEntries)) % 11]);
    15681569    AssertMsg(cEntries < PGMMAPSET_MAX_FILL, ("%u\n", cEntries));
    15691570    if (cEntries > RT_ELEMENTS(pSet->aEntries) * 50 / 100)
     
    15891590    uint32_t cEntries = pSet->cEntries;
    15901591    AssertReturnVoid(cEntries != PGMMAPSET_CLOSED);
     1592    STAM_COUNTER_INC(&pVCpu->pVMR0->pgm.s.aStatR0DynMapSetSize[(cEntries * 10 / RT_ELEMENTS(pSet->aEntries)) % 11]);
    15911593    if (cEntries >= RT_ELEMENTS(pSet->aEntries) * 45 / 100)
    15921594    {
     
    17331735{
    17341736    PPGMMAPSET      pSet = &pVCpu->pgm.s.AutoSet;
    1735     AssertReturnVoid(pSet->cEntries != PGMMAPSET_CLOSED);
     1737    uint32_t        cEntries = pSet->cEntries;
     1738    AssertReturnVoid(cEntries != PGMMAPSET_CLOSED);
    17361739    AssertReturnVoid(pSet->iSubset <= iPrevSubset || iPrevSubset == UINT32_MAX);
    17371740Assert(iPrevSubset == UINT32_MAX);
    1738     if (    pSet->cEntries >= RT_ELEMENTS(pSet->aEntries) * 40 / 100
    1739         &&  pSet->cEntries != pSet->iSubset)
    1740     {
    1741         AssertMsg(pSet->cEntries < PGMMAPSET_MAX_FILL, ("%u\n", pSet->cEntries));
    1742         STAM_COUNTER_INC(&pVCpu->pVMR0->pgm.s.StatR0DynMapPopFlushes);
     1741    STAM_COUNTER_INC(&pVCpu->pVMR0->pgm.s.aStatR0DynMapSetSize[(cEntries * 10 / RT_ELEMENTS(pSet->aEntries)) % 11]);
     1742    if (    cEntries >= RT_ELEMENTS(pSet->aEntries) * 40 / 100
     1743        &&  cEntries != pSet->iSubset)
     1744    {
     1745        AssertMsg(cEntries < PGMMAPSET_MAX_FILL, ("%u\n", cEntries));
    17431746        pgmDynMapFlushSubset(pSet);
    17441747    }
     
    18881891            {
    18891892                STAM_COUNTER_INC(&pVM->pgm.s.StatR0DynMapSetSearchFlushes);
     1893                STAM_COUNTER_INC(&pVM->pgm.s.aStatR0DynMapSetSize[(pSet->cEntries * 10 / RT_ELEMENTS(pSet->aEntries)) % 11]);
    18901894                AssertMsg(pSet->cEntries < PGMMAPSET_MAX_FILL, ("%u\n", pSet->cEntries));
    18911895                pgmDynMapFlushSubset(pSet);
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