VirtualBox

Changeset 31807 in vbox for trunk


Ignore:
Timestamp:
Aug 20, 2010 9:15:56 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
65001
Message:

FT: disable large page usage
Removed debug code

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

Legend:

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

    r31790 r31807  
    2828#include <VBox/ssm.h>
    2929#include <VBox/log.h>
     30#include <VBox/pgm.h>
    3031
    3132#include <iprt/assert.h>
     
    295296        if (!pVM->ftm.s.fCheckpointingActive)
    296297        {
    297             int rc2 = PDMCritSectEnter(&pVM->ftm.s.CritSect, VERR_SEM_BUSY);
    298             AssertMsg(rc2 == VINF_SUCCESS, ("%Rrc\n", rc));
     298            rc = PDMCritSectEnter(&pVM->ftm.s.CritSect, VERR_SEM_BUSY);
     299            AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", rc));
    299300
    300301            /* sync the changed memory with the standby node. */
    301302
    302303            PDMCritSectLeave(&pVM->ftm.s.CritSect);
    303 
    304304        }
    305305        rc = RTSemEventWait(pVM->ftm.s.master.hShutdownEvent, pVM->ftm.s.uInterval);
     
    448448
    449449        pVM->fFaultTolerantMaster = true;
     450        if (PGMIsUsingLargePages(pVM))
     451        {
     452            /* Must disable large page usage as 2 MB pages are too big to write monitor. */
     453            LogRel(("FTSync: disabling large page usage.\n"));
     454            PGMSetLargePageUsage(pVM, false);
     455        }
     456        /** @todo might need to disable page fusion as well */
     457
    450458        return VMR3PowerOn(pVM);
    451459    }
  • trunk/src/VBox/VMM/PGM.cpp

    r31784 r31807  
    631631static DECLCALLBACK(int)  pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    632632# endif
    633 # ifdef DEBUG_sandervl
    634 static DECLCALLBACK(int)  pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    635 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser);
    636 # endif
    637633static DECLCALLBACK(int)  pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);
    638634#endif
     
    680676    { "pgmsharedmodules", 0, 0,     NULL,                     0,            NULL,               0,          pgmR3CmdShowSharedModules,  "",             "Print shared modules info." },
    681677#  endif
    682 # endif
    683 # ifdef DEBUG_sandervl
    684     { "pgmcountphyswrites", 2, 2,   &g_aPgmCountPhysWritesArgs[0], 2,       NULL,               0,          pgmR3CmdCountPhysWrites, "",                "Count physical page writes."},
    685678# endif
    686679    { "pgmsyncalways", 0, 0,        NULL,                     0,            NULL,               0,          pgmR3CmdSyncAlways, "",                     "Toggle permanent CR3 syncing." },
     
    16721665        rc = STAMR3RegisterF(pVM, a, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, c, b); \
    16731666        AssertRC(rc);
    1674 
    1675 # ifdef DEBUG_sandervl
    1676     PGM_REG_COUNTER(&pPGM->StatRZFTPhysPageWrite,             "/PGM/FT/RZ/PageWrite",               "The number of times a physical page was written to (FT stats).");
    1677     PGM_REG_COUNTER(&pPGM->StatR3FTPhysPageWrite,             "/PGM/FT/R3/PageWrite",               "The number of times a physical page was written to (FT stats).");
    1678 # endif
    16791667
    16801668    PGMSTATS *pStats = pVM->pgm.s.pStatsR3;
     
    21432131    if (pVM->pgm.s.fRamPreAlloc)
    21442132        rc = pgmR3PhysRamPreAllocate(pVM);
    2145 
    2146 #ifdef DEBUG_sandervl
    2147     rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pgmR3PhysWriteCountTMCallback, NULL, "Physical page write counting timer", &pVM->pgm.s.pPhysWritesCountTimer);
    2148     AssertRC(rc);
    2149 #endif
    21502133
    21512134    LogRel(("PGMR3InitFinalize: 4 MB PSE mask %RGp\n", pVM->pgm.s.GCPhys4MBPSEMask));
     
    43134296    return VINF_SUCCESS;
    43144297}
    4315 
    4316 # ifdef DEBUG_sandervl
    4317 /**
    4318  * Internal timer callback function.
    4319  *
    4320  * @param   pVM             The VM.
    4321  * @param   pTimer          The timer handle.
    4322  * @param   pvUser          User argument specified upon timer creation.
    4323  */
    4324 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser)
    4325 {
    4326     if (pVM->pgm.s.fCountingPhysWrites)
    4327     {
    4328         pgmR3PoolClearAll(pVM, true/* fFlushRemTlb */);
    4329 
    4330         /* Program next invocation. */
    4331         int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, pVM->pgm.s.u32PhysWriteCountTimerInterval);
    4332         AssertRC(rc);
    4333     }
    4334 }
    4335 
    4336 /**
    4337  * The '.pgmcountphyswrites' command.
    4338  *
    4339  * @returns VBox status.
    4340  * @param   pCmd        Pointer to the command descriptor (as registered).
    4341  * @param   pCmdHlp     Pointer to command helper functions.
    4342  * @param   pVM         Pointer to the current VM (if any).
    4343  * @param   paArgs      Pointer to (readonly) array of arguments.
    4344  * @param   cArgs       Number of arguments in the array.
    4345  */
    4346 static DECLCALLBACK(int) pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)
    4347 {
    4348     /*
    4349      * Validate input.
    4350      */
    4351     if (!pVM)
    4352         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    4353     if (    cArgs != 2
    4354         ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING
    4355         ||  paArgs[1].enmType != DBGCVAR_TYPE_NUMBER)
    4356         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n");
    4357 
    4358     if (!strcmp(paArgs[0].u.pszString, "off"))
    4359     {
    4360         if (!pVM->pgm.s.fCountingPhysWrites)
    4361             return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: not enabled!\n");
    4362 
    4363         TMTimerStop(pVM->pgm.s.pPhysWritesCountTimer);
    4364         pVM->pgm.s.fCountingPhysWrites = false;
    4365         return VINF_SUCCESS;
    4366     }
    4367     else
    4368     if (strcmp(paArgs[0].u.pszString, "on"))
    4369         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 1st argument '%s', must be 'on' or 'off'.\n", paArgs[0].u.pszString);
    4370 
    4371     if (    paArgs[1].u.u64Number < 10
    4372         ||  paArgs[1].u.u64Number > 1000)
    4373         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%d', must be between 10 and 1000 ms.\n", paArgs[1].u.u64Number);
    4374 
    4375     pVM->pgm.s.u32PhysWriteCountTimerInterval = paArgs[1].u.u64Number;
    4376     pVM->pgm.s.fCountingPhysWrites = true;
    4377     int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, paArgs[1].u.u64Number);
    4378     AssertRC(rc);
    4379     return VINF_SUCCESS;
    4380 }
    4381 # endif /* DEBUG_sandervl */
    4382 
    43834298#endif /* VBOX_STRICT */
    43844299
  • trunk/src/VBox/VMM/PGMInternal.h

    r31784 r31807  
    32243224    /** @} */
    32253225
    3226 #ifdef DEBUG_sandervl
    3227     PTMTIMERR3                      pPhysWritesCountTimer;
    3228     uint32_t                        u32PhysWriteCountTimerInterval;
    3229     bool                            fCountingPhysWrites;
    3230     uint8_t                         u8Alignment[3];
    3231 
    3232     STAMCOUNTER                     StatR3FTPhysPageWrite;              /**< R3: The number of times a physical page was written to (FT stats) */
    3233     STAMCOUNTER                     StatRZFTPhysPageWrite;              /**< RC/R0: The number of times a physical page was written to (FT stats) */
    3234 #endif
    3235 
    32363226#ifdef VBOX_WITH_STATISTICS
    32373227    /** @name Statistics on the heap.
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r31784 r31807  
    21772177
    21782178                PGM_BTH_NAME(SyncPageWorker)(pVCpu, &pPTDst->a[iPTDst], PdeSrc, PteSrc, pShwPage, iPTDst);
    2179 #ifdef DEBUG_sandervl
    2180                 if (pVM->pgm.s.fCountingPhysWrites)
    2181                     pPTDst->a[iPTDst].n.u1Write = 0;
    2182 #endif
    2183 
    21842179                Log2(("SyncPage: 4K+ %RGv PteSrc:{P=%d RW=%d U=%d raw=%08llx} PteDst=%08llx%s\n",
    21852180                      GCPtrCurPage, PteSrc.n.u1Present,
     
    22032198        RTGCPTR         GCPtrCurPage = (GCPtrPage & ~(RTGCPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT);
    22042199        GSTPTE          PteSrc;
    2205 
    2206 #ifdef DEBUG_sandervl
    2207         if (    pVM->pgm.s.fCountingPhysWrites
    2208             &&  ((uErr & (X86_TRAP_PF_RW|X86_TRAP_PF_P)) == (X86_TRAP_PF_RW|X86_TRAP_PF_P)))
    2209         {
    2210             STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat, FTPhysPageWrite));
    2211         }
    2212 #endif
    22132200
    22142201        /* Fake the page table entry */
Note: See TracChangeset for help on using the changeset viewer.

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