Changeset 5244 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 11, 2007 4:33:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r5240 r5244 108 108 GVMHANDLE aHandles[128]; 109 109 110 /** The minimum sleep time, in nano seconds. 111 * @gcfgm /GVMM/MinSleep 32-bit 0..100000000 112 */ 113 uint32_t nsMinSleep; 110 /** The number of VMs that means we no longer considers ourselves along on a CPU/Core. 111 * @gcfgm /GVMM/cVMsMeansCompany 32-bit 0..UINT32_MAX 112 */ 113 uint32_t cVMsMeansCompany; 114 /** The minimum sleep time for when we're alone, in nano seconds. 115 * @gcfgm /GVMM/MinSleepAlone 32-bit 0..100000000 116 */ 117 uint32_t nsMinSleepAlone; 118 /** The minimum sleep time for when we've got company, in nano seconds. 119 * @gcfgm /GVMM/MinSleepCompany 32-bit 0..100000000 120 */ 121 uint32_t nsMinSleepCompany; 114 122 /** The limit for the first round of early wakeups, given in nano seconds. 115 * @gcfgm /GVMM/EarlyWakeUp1 32-bit 0..100000000123 * @gcfgm /GVMM/EarlyWakeUp1 32-bit 0..100000000 116 124 */ 117 125 uint32_t nsEarlyWakeUp1; 118 126 /** The limit for the second round of early wakeups, given in nano seconds. 119 * @gcfgm /GVMM/EarlyWakeUp2 32-bit 0..100000000127 * @gcfgm /GVMM/EarlyWakeUp2 32-bit 0..100000000 120 128 */ 121 129 uint32_t nsEarlyWakeUp2; … … 216 224 217 225 /* The default configuration values. */ 218 pGVMM->nsMinSleep = 750000 /* ns (0.750 ms) */; /** @todo this should be adjusted to be 75% (or something) of the scheduler granularity... */ 219 pGVMM->nsEarlyWakeUp1 = 25000 /* ns (0.025 ms) */; 220 pGVMM->nsEarlyWakeUp2 = 50000 /* ns (0.050 ms) */; 226 pGVMM->cVMsMeansCompany = 1; /** @todo should be adjusted to relative to the cpu count or something... */ 227 pGVMM->nsMinSleepAlone = 750000 /* ns (0.750 ms) */; /** @todo this should be adjusted to be 75% (or something) of the scheduler granularity... */ 228 pGVMM->nsMinSleepCompany = 15000 /* ns (0.015 ms) */; 229 pGVMM->nsEarlyWakeUp1 = 25000 /* ns (0.025 ms) */; 230 pGVMM->nsEarlyWakeUp2 = 50000 /* ns (0.050 ms) */; 221 231 222 232 g_pGVMM = pGVMM; … … 296 306 int rc = VINF_SUCCESS; 297 307 pszName += sizeof("/GVMM/") - 1; 298 if (!strcmp(pszName, "MinSleep")) 308 if (!strcmp(pszName, "cVMsMeansCompany")) 309 { 310 if (u64Value <= UINT32_MAX) 311 pGVMM->cVMsMeansCompany = u64Value; 312 else 313 rc = VERR_OUT_OF_RANGE; 314 } 315 else if (!strcmp(pszName, "MinSleepAlone")) 299 316 { 300 317 if (u64Value <= 100000000) 301 pGVMM->nsMinSleep = u64Value; 318 pGVMM->nsMinSleepAlone = u64Value; 319 else 320 rc = VERR_OUT_OF_RANGE; 321 } 322 else if (!strcmp(pszName, "MinSleepCompany")) 323 { 324 if (u64Value <= 100000000) 325 pGVMM->nsMinSleepCompany = u64Value; 302 326 else 303 327 rc = VERR_OUT_OF_RANGE; … … 350 374 int rc = VINF_SUCCESS; 351 375 pszName += sizeof("/GVMM/") - 1; 352 if (!strcmp(pszName, "MinSleep")) 353 *pu64Value = pGVMM->nsMinSleep; 376 if (!strcmp(pszName, "cVMsMeansCompany")) 377 *pu64Value = pGVMM->cVMsMeansCompany; 378 else if (!strcmp(pszName, "MinSleepAlone")) 379 *pu64Value = pGVMM->nsMinSleepAlone; 380 else if (!strcmp(pszName, "MinSleepCompany")) 381 *pu64Value = pGVMM->nsMinSleepCompany; 354 382 else if (!strcmp(pszName, "EarlyWakeUp1")) 355 383 *pu64Value = pGVMM->nsEarlyWakeUp1; … … 1348 1376 */ 1349 1377 if ( u64Now < u64ExpireGipTime 1350 && ( pGVMM->cVMs > 1 1351 || (u64ExpireGipTime - u64Now >= pGVMM->nsMinSleep))) 1378 && u64ExpireGipTime - u64Now > (pGVMM->cVMs > pGVMM->cVMsMeansCompany 1379 ? pGVMM->nsMinSleepCompany 1380 : pGVMM->nsMinSleepAlone)) 1352 1381 { 1353 1382 pGVM->gvmm.s.StatsSched.cHaltBlocking++;
Note:
See TracChangeset
for help on using the changeset viewer.