Changeset 19707 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- May 14, 2009 5:36:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r19660 r19707 115 115 // /** The number of halted EMT threads. */ 116 116 // uint16_t volatile cHaltedEMTs; 117 /** The number of EMTs. */ 118 uint32_t volatile cEMTs; 117 119 /** The lock used to serialize VM creation, destruction and associated events that 118 120 * isn't performance critical. Owners may acquire the list lock. */ … … 127 129 GVMHANDLE aHandles[GVMM_MAX_HANDLES]; 128 130 129 /** @gcfgm{/GVMM/cVMsMeansCompany, 32-bit, 0, UINT32_MAX, 1} 130 * The number of VMs that means we no longer consider ourselves alone on a CPU/Core. 131 */ 132 uint32_t cVMsMeansCompany; 131 /** @gcfgm{/GVMM/cEMTsMeansCompany, 32-bit, 0, UINT32_MAX, 1} 132 * The number of EMTs that means we no longer consider ourselves alone on a 133 * CPU/Core. 134 */ 135 uint32_t cEMTsMeansCompany; 133 136 /** @gcfgm{/GVMM/MinSleepAlone,32-bit, 0, 100000000, 750000, ns} 134 137 * The minimum sleep time for when we're alone, in nano seconds. … … 243 246 244 247 /* The default configuration values. */ 245 pGVMM->c VMsMeansCompany= 1; /** @todo should be adjusted to relative to the cpu count or something... */248 pGVMM->cEMTsMeansCompany = 1; /** @todo should be adjusted to relative to the cpu count or something... */ 246 249 pGVMM->nsMinSleepAlone = 750000 /* ns (0.750 ms) */; /** @todo this should be adjusted to be 75% (or something) of the scheduler granularity... */ 247 250 pGVMM->nsMinSleepCompany = 15000 /* ns (0.015 ms) */; … … 291 294 if (pGVMM->iUsedHead) 292 295 { 293 SUPR0Printf("GVMMR0Term: iUsedHead=%#x! (cVMs=%#x )\n", pGVMM->iUsedHead, pGVMM->cVMs);296 SUPR0Printf("GVMMR0Term: iUsedHead=%#x! (cVMs=%#x cEMTs=%#x)\n", pGVMM->iUsedHead, pGVMM->cVMs, pGVMM->cEMTs); 294 297 pGVMM->iUsedHead = 0; 295 298 } … … 325 328 int rc = VINF_SUCCESS; 326 329 pszName += sizeof("/GVMM/") - 1; 327 if (!strcmp(pszName, "c VMsMeansCompany"))330 if (!strcmp(pszName, "cEMTsMeansCompany")) 328 331 { 329 332 if (u64Value <= UINT32_MAX) 330 pGVMM->c VMsMeansCompany = u64Value;333 pGVMM->cEMTsMeansCompany = u64Value; 331 334 else 332 335 rc = VERR_OUT_OF_RANGE; … … 393 396 int rc = VINF_SUCCESS; 394 397 pszName += sizeof("/GVMM/") - 1; 395 if (!strcmp(pszName, "c VMsMeansCompany"))396 *pu64Value = pGVMM->c VMsMeansCompany;398 if (!strcmp(pszName, "cEMTsMeansCompany")) 399 *pu64Value = pGVMM->cEMTsMeansCompany; 397 400 else if (!strcmp(pszName, "MinSleepAlone")) 398 401 *pu64Value = pGVMM->nsMinSleepAlone; … … 655 658 pGVM->pVM = pVM; 656 659 pGVM->aCpus[0].hEMT = hEMT0; 660 pGVMM->cEMTs += cCpus; 657 661 658 662 gvmmR0UsedUnlock(pGVMM); … … 997 1001 pGVMM->cVMs--; 998 1002 999 gvmmR0UsedUnlock(pGVMM);1000 1001 1003 /* 1002 1004 * Do the global cleanup round. … … 1006 1008 && pGVM->u32Magic == GVM_MAGIC) 1007 1009 { 1010 pGVMM->cEMTs -= pGVM->cCpus; 1011 gvmmR0UsedUnlock(pGVMM); 1012 1008 1013 gvmmR0CleanupVM(pGVM); 1009 1014 … … 1048 1053 pGVM->u32Magic |= UINT32_C(0x80000000); 1049 1054 RTMemFree(pGVM); 1050 } 1051 /* else: GVMMR0CreateVM cleanup. */ 1055 1056 /* Re-acquire the UsedLock before freeing the handle since we're updating handle fields. */ 1057 rc = gvmmR0UsedLock(pGVMM); 1058 AssertRC(rc); 1059 } 1060 /* else: GVMMR0CreateVM cleanup. */ 1052 1061 1053 1062 /* 1054 1063 * Free the handle. 1055 * Reacquire the UsedLock here to since we're updating handle fields. 1056 */ 1057 rc = gvmmR0UsedLock(pGVMM); 1058 AssertRC(rc); 1059 1064 */ 1060 1065 pHandle->iNext = pGVMM->iFreeHead; 1061 1066 pGVMM->iFreeHead = iHandle; … … 1537 1542 */ 1538 1543 if ( u64Now < u64ExpireGipTime 1539 && u64ExpireGipTime - u64Now > (pGVMM->c VMs > pGVMM->cVMsMeansCompany1544 && u64ExpireGipTime - u64Now > (pGVMM->cEMTs > pGVMM->cEMTsMeansCompany 1540 1545 ? pGVMM->nsMinSleepCompany 1541 1546 : pGVMM->nsMinSleepAlone)) … … 1921 1926 */ 1922 1927 pStats->cVMs = 0; 1928 pStats->cEMTs = 0; 1923 1929 memset(&pStats->SchedSum, 0, sizeof(pStats->SchedSum)); 1924 1930 … … 1935 1941 { 1936 1942 pStats->cVMs++; 1943 pStats->cEMTs += pGVM->cCpus; 1937 1944 1938 1945 pStats->SchedSum.cHaltCalls += pGVM->gvmm.s.StatsSched.cHaltCalls;
Note:
See TracChangeset
for help on using the changeset viewer.