VirtualBox

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


Ignore:
Timestamp:
Oct 11, 2007 4:33:17 PM (17 years ago)
Author:
vboxsync
Message:

Some more tuning wheels and nobs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r5240 r5244  
    108108    GVMHANDLE           aHandles[128];
    109109
    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;
    114122    /** The limit for the first round of early wakeups, given in nano seconds.
    115      * @gcfgm   /GVMM/EarlyWakeUp1  32-bit  0..100000000
     123     * @gcfgm   /GVMM/EarlyWakeUp1      32-bit  0..100000000
    116124     */
    117125    uint32_t            nsEarlyWakeUp1;
    118126    /** The limit for the second round of early wakeups, given in nano seconds.
    119      * @gcfgm   /GVMM/EarlyWakeUp2  32-bit  0..100000000
     127     * @gcfgm   /GVMM/EarlyWakeUp2      32-bit  0..100000000
    120128     */
    121129    uint32_t            nsEarlyWakeUp2;
     
    216224
    217225            /* 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) */;
    221231
    222232            g_pGVMM = pGVMM;
     
    296306    int rc = VINF_SUCCESS;
    297307    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"))
    299316    {
    300317        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;
    302326        else
    303327            rc = VERR_OUT_OF_RANGE;
     
    350374    int rc = VINF_SUCCESS;
    351375    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;
    354382    else if (!strcmp(pszName, "EarlyWakeUp1"))
    355383        *pu64Value = pGVMM->nsEarlyWakeUp1;
     
    13481376     */
    13491377    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))
    13521381    {
    13531382        pGVM->gvmm.s.StatsSched.cHaltBlocking++;
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