VirtualBox

Changeset 89194 in vbox


Ignore:
Timestamp:
May 20, 2021 9:28:17 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144535
Message:

Intel IOMMU: bugref:9967 Threading nit, better to be woken up slightly more often than missing wake ups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuIntel.cpp

    r89068 r89194  
    263263    /** The event semaphore the invalidation-queue thread waits on. */
    264264    SUPSEMEVENT                 hEvtInvQueue;
    265     /** Whether the invalidation-queue thread has been signaled. */
    266     bool volatile               fInvQueueThreadSignaled;
    267265    /** Padding. */
    268     bool                        afPadding0[3];
     266    uint32_t                    uPadding0;
    269267    /** Error diagnostic. */
    270268    DMARDIAG                    enmDiag;
     
    10581056
    10591057    if (    dmarInvQueueCanProcessRequests(pThis)
    1060         && !dmarInvQueueIsEmpty(pThis)
    1061         && !ASMAtomicXchgBool(&pThis->fInvQueueThreadSignaled, true))
    1062     {
    1063         Log4Func(("Signaling the invalidation-queue thread\n"));
     1058        && !dmarInvQueueIsEmpty(pThis))
     1059    {
     1060        Log4Func(("Signaling the invalidation-queue thread!!\n"));
    10641061        PDMDevHlpSUPSemEventSignal(pDevIns, pThis->hEvtInvQueue);
    10651062    }
     
    22712268         * Sleep until we are woken up.
    22722269         */
    2273         bool const fSignaled = ASMAtomicXchgBool(&pThis->fInvQueueThreadSignaled, false);
    2274         if (!fSignaled)
    22752270        {
    22762271            int const rc = PDMDevHlpSUPSemEventWaitNoResume(pDevIns, pThis->hEvtInvQueue, RT_INDEFINITE_WAIT);
     
    22782273            if (RT_UNLIKELY(pThread->enmState != PDMTHREADSTATE_RUNNING))
    22792274                break;
    2280             ASMAtomicWriteBool(&pThis->fInvQueueThreadSignaled, false);
    22812275        }
    22822276
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