VirtualBox

Changeset 26479 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 13, 2010 12:36:53 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Don't spawn a new I/O manager if only one endpoint produces the load. Fixes huge amount of I/O managers during I/O intensive tasks

File:
1 edited

Legend:

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

    r26338 r26479  
    202202}
    203203
     204static bool pdmacFileAioMgrNormalIsBalancePossible(PPDMACEPFILEMGR pAioMgr)
     205{
     206    /* Balancing doesn't make sense with only one endpoint. */
     207    if (pAioMgr->cEndpoints == 1)
     208        return false;
     209
     210    /* Doesn't make sens to move endpoints if only one produces the whole load */
     211    unsigned cEndpointsWithLoad = 0;
     212
     213    PPDMASYNCCOMPLETIONENDPOINTFILE pCurr = pAioMgr->pEndpointsHead;
     214
     215    while (pCurr)
     216    {
     217        if (pCurr->AioMgr.cReqsPerSec)
     218            cEndpointsWithLoad++;
     219
     220        pCurr = pCurr->AioMgr.pEndpointNext;
     221    }
     222
     223    return (cEndpointsWithLoad > 1);
     224}
     225
    204226/**
    205227 * Creates a new I/O manager and spreads the I/O load of the endpoints
     
    214236    int rc = VINF_SUCCESS;
    215237
    216     /* Splitting can't be done with only one open endpoint. */
    217     if (pAioMgr->cEndpoints > 1)
     238    /*
     239     * Check if balancing would improve the situation.
     240     */
     241    if (pdmacFileAioMgrNormalIsBalancePossible(pAioMgr))
    218242    {
    219243        rc = pdmacFileAioMgrCreate((PPDMASYNCCOMPLETIONEPCLASSFILE)pAioMgr->pEndpointsHead->Core.pEpClass,
     
    274298        }
    275299    }
     300    else
     301        Log(("AIOMgr: Load balancing would not improve anything\n"));
    276302}
    277303
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