Changeset 27978 in vbox
- Timestamp:
- Apr 4, 2010 7:22:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMAsyncCompletionFile.cpp
r27920 r27978 68 68 ASMAtomicIncU32(&pEndpoint->cTasksCached); 69 69 } 70 else if (false)71 {72 /* Bigger class cache */73 }74 70 else 75 71 { … … 95 91 PPDMASYNCCOMPLETIONEPCLASSFILE pEndpointClass = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->Core.pEpClass; 96 92 97 #if 0 98 /* We start with the assigned slot id to distribute the load when allocating new tasks. */ 99 unsigned iSlot = pEndpoint->iSlotStart; 100 do 101 { 102 pTask = (PPDMASYNCCOMPLETIONTASK)ASMAtomicXchgPtr((void * volatile *)&pEndpointClass->apTaskCache[iSlot], NULL); 103 if (pTask) 104 break; 105 106 iSlot = (iSlot + 1) % RT_ELEMENTS(pEndpointClass->apTaskCache); 107 } while (iSlot != pEndpoint->iSlotStart); 108 #endif 109 if (!pTask) 110 { 111 /* 112 * Allocate completely new. 113 * If this fails we return NULL. 114 */ 115 int rc = MMR3HeapAllocZEx(pEndpointClass->Core.pVM, MM_TAG_PDM_ASYNC_COMPLETION, 116 sizeof(PDMACTASKFILE), 117 (void **)&pTask); 118 if (RT_FAILURE(rc)) 119 pTask = NULL; 120 121 LogFlow(("Allocated task %p\n", pTask)); 122 } 123 #if 0 124 else 125 { 126 /* Remove the first element and put the rest into the slot again. */ 127 PPDMASYNCCOMPLETIONTASK pTaskHeadNew = pTask->pNext; 128 129 pTaskHeadNew->pPrev = NULL; 130 131 /* Put back into the list adding any new tasks. */ 132 while (true) 133 { 134 bool fChanged = ASMAtomicCmpXchgPtr((void * volatile *)&pEndpointClass->apTaskCache[iSlot], pTaskHeadNew, NULL); 135 136 if (fChanged) 137 break; 138 139 PPDMASYNCCOMPLETIONTASK pTaskHead = (PPDMASYNCCOMPLETIONTASK)ASMAtomicXchgPtr((void * volatile *)&pEndpointClass->apTaskCache[iSlot], NULL); 140 141 /* The new task could be taken inbetween */ 142 if (pTaskHead) 143 { 144 /* Go to the end of the probably much shorter new list. */ 145 PPDMASYNCCOMPLETIONTASK pTaskTail = pTaskHead; 146 while (pTaskTail->pNext) 147 pTaskTail = pTaskTail->pNext; 148 149 /* Concatenate */ 150 pTaskTail->pNext = pTaskHeadNew; 151 152 pTaskHeadNew = pTaskHead; 153 } 154 /* Another round trying to change the list. */ 155 } 156 /* We got a task from the global cache so decrement the counter */ 157 ASMAtomicDecU32(&pEndpointClass->cTasksCached); 158 } 159 #endif 93 /* 94 * Allocate completely new. 95 * If this fails we return NULL. 96 */ 97 int rc = MMR3HeapAllocZEx(pEndpointClass->Core.pVM, MM_TAG_PDM_ASYNC_COMPLETION, 98 sizeof(PDMACTASKFILE), 99 (void **)&pTask); 100 if (RT_FAILURE(rc)) 101 pTask = NULL; 102 103 LogFlow(("Allocated task %p\n", pTask)); 160 104 } 161 105 else … … 524 468 rc = CFGMR3QueryU32Def(pCfgNode, "VMTransferPerSecMax", &pBwMgr->cbVMTransferPerSecMax, UINT32_MAX); 525 469 AssertLogRelRCReturn(rc, rc); 526 rc = CFGMR3QueryU32Def(pCfgNode, "VMTransferPerSecStart", &pBwMgr->cbVMTransferPerSecStart, 5 * _1M);470 rc = CFGMR3QueryU32Def(pCfgNode, "VMTransferPerSecStart", &pBwMgr->cbVMTransferPerSecStart, UINT32_MAX /*5 * _1M*/); 527 471 AssertLogRelRCReturn(rc, rc); 528 472 rc = CFGMR3QueryU32Def(pCfgNode, "VMTransferPerSecStep", &pBwMgr->cbVMTransferPerSecStep, _1M);
Note:
See TracChangeset
for help on using the changeset viewer.