View | Details | Raw Unified | Return to bug 168298 | Differences between
and this patch

Collapse All | Expand All

(-)src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp (-2 / +41 lines)
Lines 27-32 Link Here
27
#include <iprt/string.h>
27
#include <iprt/string.h>
28
#include <iprt/assert.h>
28
#include <iprt/assert.h>
29
#include <VBox/log.h>
29
#include <VBox/log.h>
30
/* TBR: we need a complicated crawl through the data structure to get the AIO system limits
31
   to check when considering growing the number of active AIO requests.... */
32
/* We need the PDMInternal *before* the UVM, or it isn't visible afterwards. (src/VBox/VMM/include/PDMInternal.h) */
33
#include <PDMInternal.h>
34
#include <VBox/vmm/uvm.h>
35
#include <VBox/vmm/vm.h>
36
/* TBR: end of extra includes. */
30
37
31
#include "PDMAsyncCompletionFileInternal.h"
38
#include "PDMAsyncCompletionFileInternal.h"
32
39
Lines 1120-1127 Link Here
1120
             */
1127
             */
1121
            pdmacFileAioMgrNormalBalanceLoad(pAioMgr);
1128
            pdmacFileAioMgrNormalBalanceLoad(pAioMgr);
1122
#else
1129
#else
1123
            /* Grow the I/O manager */
1130
            /* TBR: Check the global AIO system limit before growing.
1124
            pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING;
1131
                    This is the complicateds crawl through the data structure mentioned
1132
                    near the start of this file.
1133
                    There HAS to be a better way and better time to get this limit! */
1134
            PPDMASYNCCOMPLETIONEPCLASS pEpClass = NULL;
1135
            PCPDMASYNCCOMPLETIONEPCLASSOPS pEndpointOps = NULL;
1136
            PDMASYNCCOMPLETIONEPCLASSTYPE enmClassType;
1137
            PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = NULL;
1138
            PVM pVM = NULL;
1139
            PUVM pUVM = NULL;
1140
            unsigned int aio_system_reqests_max = RTFILEAIO_UNLIMITED_REQS;
1141
            pEpClass = pEndpoint->Core.pEpClass;
1142
            AssertMsg((NULL != pEpClass),("ep->class is NULL"));
1143
            pEndpointOps = pEpClass->pEndpointOps;
1144
            AssertMsg((NULL != pEndpointOps),("ep->class->ops is NULL"));
1145
            enmClassType = pEndpointOps->enmClassType;
1146
            AssertMsg((PDMASYNCCOMPLETIONEPCLASSTYPE_FILE == enmClassType),
1147
                      ("ep->class->ops->type != PDMASYNCCOMPLETIONEPCLASSTYPE_FILE"));
1148
            pVM = pEpClass->pVM;
1149
            AssertMsg((NULL != pVM),("ep->class->VM is NULL"));
1150
            pUVM = pVM->pUVM;
1151
            AssertMsg((NULL != pUVM),("ep->class->VM->UVM is NULL"));
1152
            pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE) (pUVM->pdm.s.apAsyncCompletionEndpointClass[enmClassType]);
1153
            AssertMsg((NULL != pEpClassFile),("ep->class->VM->UVM->pdn[globals] is NULL"));
1154
            aio_system_reqests_max = pEpClassFile->cReqsOutstandingMax;
1155
#if 0
1156
            /* A one time check during development to verify getting the right number. */
1157
            AssertMsg((256 != aio_system_reqests_max),
1158
                      ("aio_system_reqests_max != 256 (val=%u)",aio_system_reqests_max));
1159
#endif
1160
            if (RT_UNLIKELY(   aio_system_reqests_max == RTFILEAIO_UNLIMITED_REQS
1161
                            || (pAioMgr->cRequestsActiveMax+PDMACEPFILEMGR_REQS_STEP) <= aio_system_reqests_max))
1162
                /* Grow the I/O manager */
1163
                pAioMgr->enmState = PDMACEPFILEMGRSTATE_GROWING;
1125
#endif
1164
#endif
1126
        }
1165
        }
1127
    }
1166
    }

Return to bug 168298