VirtualBox

Changeset 15879 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 8, 2009 6:39:41 PM (16 years ago)
Author:
vboxsync
Message:

ATA: Wait a bit until we interrupt the thread to avoid interruptions if running in gdb

Location:
trunk/src/VBox/Devices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r15855 r15879  
    409409    uint32_t            Alignment0;
    410410#endif
     411
     412    /** Timestamp we started the reset. */
     413    uint64_t            u64ResetTime;
    411414
    412415    /* Statistics */
     
    37313734                PDMCritSectLeave(&pCtl->lock);
    37323735
     3736#ifndef RT_OS_WINDOWS
     3737                /*
     3738                 * The thread might be stuck in an I/O operation
     3739                 * due to a high I/O load on the host. (see @bugref{3301})
     3740                 * To perform the reset successfully
     3741                 * we interrupt the operation by sending a signal to the thread
     3742                 * if the thread didn't responded in 10ms.
     3743                 * This works only on POSIX hosts (Windows has a CancelSynchronousIo function which
     3744                 * does the same but it was introduced with Vista) but so far
     3745                 * this hang was only observed on Linux and Mac OS X.
     3746                 *
     3747                 * This is a workaround and needs to be solved properly.
     3748                 */
     3749                if (pCtl->fReset)
     3750                {
     3751                    uint64_t u64ResetTimeStop = RTTimeMilliTS();
     3752
     3753                    if ((u64ResetTimeStop - pCtl->u64ResetTime) >= 10)
     3754                    {
     3755                        LogRel(("PIIX3 ATA: Async I/O thread probably stuck in operation, interrupting\n"));
     3756                        pCtl->u64ResetTime = u64ResetTimeStop;
     3757                        RTThreadPoke(pCtl->AsyncIOThread);
     3758                    }
     3759                }
     3760#endif
     3761
    37333762                RTThreadYield();
    37343763
     
    38243853        }
    38253854
    3826         /*
    3827          * The thread might be stuck in an I/O operation
    3828          * due to a high I/O load on the host. (see @bugref{3301})
    3829          * To perform the reset successfully
    3830          * we interrupt the operation by sending a signal to the thread.
    3831          * This works only on POSIX hosts (Windows has a CancelSynchronousIo function which
    3832          * does the same but it was introduced with Vista) but so far
    3833          * this hang was only observed on Linux and Mac OS X.
    3834          *
    3835          * This is a workaround and needs to be solved properly.
    3836          */
    3837 #ifndef RT_OS_WINDOWS
    3838         RTThreadPoke(pCtl->AsyncIOThread);
    3839 #endif
     3855        /* Save the timestamp we started the reset. */
     3856        pCtl->u64ResetTime = RTTimeMilliTS();
    38403857
    38413858        /* Issue the reset request now. */
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp

    r15855 r15879  
    750750    GEN_CHECK_OFF(ATACONTROLLER, SuspendIOSem);
    751751    GEN_CHECK_OFF(ATACONTROLLER, DelayIRQMillies);
     752    GEN_CHECK_OFF(ATACONTROLLER, u64ResetTime);
    752753    GEN_CHECK_OFF(ATACONTROLLER, StatAsyncOps);
    753754    GEN_CHECK_OFF(ATACONTROLLER, StatAsyncMinWait);
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