VirtualBox

Ignore:
Timestamp:
Jul 13, 2015 12:34:53 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101627
Message:

HostDrivers/Support: Change the TSC-delta thread waiting to an interruptible sleep and increase sleep timeout to 60 seconds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrvGip.cpp

    r55436 r56924  
    40824082                RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
    40834083
    4084                 /* Simple adaptive timeout. */
    4085                 if (cConsecutiveTimeouts++ == 10)
    4086                 {
    4087                     if (pDevExt->cMsTscDeltaTimeout == 1)           /* 10 ms */
    4088                         pDevExt->cMsTscDeltaTimeout = 10;
    4089                     else if (pDevExt->cMsTscDeltaTimeout == 10)     /* +100 ms */
    4090                         pDevExt->cMsTscDeltaTimeout = 100;
    4091                     else if (pDevExt->cMsTscDeltaTimeout == 100)    /* +1000 ms */
    4092                         pDevExt->cMsTscDeltaTimeout = 500;
    4093                     cConsecutiveTimeouts = 0;
    4094                 }
    4095                 rc = RTThreadUserWait(pDevExt->hTscDeltaThread, pDevExt->cMsTscDeltaTimeout);
     4084                /*
     4085                 * Linux counts uninterruptible sleeps as load, hence we shall do a
     4086                 * regular, interruptible sleep here and ignore wake ups due to signals.
     4087                 * See task_contributes_to_load() in include/linux/sched.h in the Linux sources.
     4088                 */
     4089                rc = RTThreadUserWaitNoResume(pDevExt->hTscDeltaThread, pDevExt->cMsTscDeltaTimeout);
    40964090                if (   RT_FAILURE(rc)
    4097                     && rc != VERR_TIMEOUT)
     4091                    && rc != VERR_TIMEOUT
     4092                    && rc != VERR_INTERRUPTED)
    40984093                    return supdrvTscDeltaThreadButchered(pDevExt, false /* fSpinlockHeld */, "RTThreadUserWait", rc);
    40994094                RTThreadUserReset(pDevExt->hTscDeltaThread);
     
    41084103                    return supdrvTscDeltaThreadButchered(pDevExt, true /* fSpinlockHeld */, "RTSemEventSignal", rc);
    41094104                RTSpinlockRelease(pDevExt->hTscDeltaSpinlock);
    4110                 pDevExt->cMsTscDeltaTimeout = 1;
    41114105                RTThreadSleep(1);
    41124106                /* fall thru */
     
    43434337        {
    43444338            pDevExt->enmTscDeltaThreadState = kTscDeltaThreadState_Creating;
    4345             pDevExt->cMsTscDeltaTimeout = 1;
     4339            pDevExt->cMsTscDeltaTimeout = 60000;
    43464340            rc = RTThreadCreate(&pDevExt->hTscDeltaThread, supdrvTscDeltaThread, pDevExt, 0 /* cbStack */,
    43474341                                RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "VBoxTscThread");
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