VirtualBox

Changeset 18354 in vbox


Ignore:
Timestamp:
Mar 26, 2009 10:17:20 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
45140
Message:

MMHyper: With lots of memory, we have to scale up the hyper heap size according to the memory size. We have extra expenses tracking memory we've mapped, this has to be accessible from R0. However, we don't really need this in RC, so it's one of the allocations we could put in a R3/R0 only heap later.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/MMHyper.cpp

    r18291 r18354  
    7878    int rc = CFGMR3QueryU32(CFGMR3GetChild(CFGMR3GetRoot(pVM), "MM"), "cbHyperHeap", &cbHyperHeap);
    7979    if (rc == VERR_CFGM_NO_PARENT || rc == VERR_CFGM_VALUE_NOT_FOUND)
     80    {
    8081        cbHyperHeap = VMMIsHwVirtExtForced(pVM)
    8182                    ? 640*_1K
    8283                    : 1280*_1K;
    83     else if (RT_FAILURE(rc))
    84     {
    85         LogRel(("MM/cbHyperHeap query -> %Rrc\n", rc));
    86         AssertRCReturn(rc, rc);
    87     }
     84
     85        /* Adjust for dynamic stuff like RAM mapping chunks. Try playing kind
     86           of safe with existing configs here (HMA size must not change)... */
     87        uint64_t cbRam;
     88        CFGMR3QueryU64Def(CFGMR3GetRoot(pVM), "RamSize", &cbRam, 0);
     89        if (cbRam > _2G)
     90        {
     91            cbRam = RT_MIN(cbRam, _1T);
     92            cbHyperHeap += (cbRam - _1G) / _1M * 128; /* 128 is a quick guess */
     93            cbHyperHeap = RT_ALIGN_32(cbHyperHeap, _64K);
     94        }
     95    }
     96    else
     97        AssertLogRelRCReturn(rc, rc);
    8898    cbHyperHeap = RT_ALIGN_32(cbHyperHeap, PAGE_SIZE);
     99    LogRel(("MM: cbHyperHeap=%#x (%u)\n", cbHyperHeap, cbHyperHeap));
    89100
    90101    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette