VirtualBox

Changeset 2884 in vbox for trunk/src


Ignore:
Timestamp:
May 25, 2007 4:57:28 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21543
Message:

Abort any pending catchup and reset. Fixed broken DoQueuesRun statistics.

File:
1 edited

Legend:

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

    r2869 r2884  
    719719
    720720    /*
     721     * Abort any pending catch up.
     722     * This isn't perfect,
     723     */
     724    if (pVM->tm.s.fVirtualSyncCatchUp)
     725    {
     726        const uint64_t offVirtualNow = TMVirtualGetEx(pVM, false /* don't check timers */);
     727        const uint64_t offVirtualSyncNow = TMVirtualSyncGetEx(pVM, false /* don't check timers */);
     728        if (pVM->tm.s.fVirtualSyncCatchUp)
     729        {
     730            STAM_PROFILE_ADV_STOP(&pVM->tm.s.StatVirtualSyncCatchup, c);
     731
     732            const uint64_t offOld = pVM->tm.s.offVirtualSyncGivenUp;
     733            const uint64_t offNew = offVirtualNow - offVirtualSyncNow;
     734            Assert(offOld <= offNew);
     735            ASMAtomicXchgU64((uint64_t volatile *)&pVM->tm.s.offVirtualSyncGivenUp, offNew);
     736            ASMAtomicXchgU64((uint64_t volatile *)&pVM->tm.s.offVirtualSync, offNew);
     737            ASMAtomicXchgBool(&pVM->tm.s.fVirtualSyncCatchUp, false);
     738            LogRel(("TM: Aborting catch-up attempt on reset with a %RU64 ns lag on reset; new total: %RU64 ns\n", offOld - offNew, offNew));
     739        }
     740    }
     741
     742    /*
    721743     * Process the queues.
    722744     */
     
    12281250    tmTimerQueueSchedule(pVM, &pVM->tm.s.paTimerQueuesR3[TMCLOCK_VIRTUAL_SYNC]);
    12291251    STAM_PROFILE_ADV_SUSPEND(&pVM->tm.s.StatDoQueuesSchedule, s1);
    1230     STAM_PROFILE_ADV_STOP(&pVM->tm.s.StatDoQueuesRun, r1);
     1252    STAM_PROFILE_ADV_START(&pVM->tm.s.StatDoQueuesRun, r1);
    12311253    tmR3TimerQueueRunVirtualSync(pVM);
    12321254    STAM_PROFILE_ADV_SUSPEND(&pVM->tm.s.StatDoQueuesRun, r1);
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