VirtualBox

Changeset 29551 in vbox


Ignore:
Timestamp:
May 17, 2010 2:15:41 PM (15 years ago)
Author:
vboxsync
Message:

Rewrote previous accounting fix

File:
1 edited

Legend:

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

    r29548 r29551  
    18231823    {
    18241824        case GMMACCOUNT_BASE:
    1825             if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cBalloonedPages + pGVM->gmm.s.cSharedPages + cPages > pGVM->gmm.s.Reserved.cBasePages))
     1825            if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cBalloonedPages + cPages > pGVM->gmm.s.Reserved.cBasePages))
    18261826            {
    18271827                Log(("gmmR0AllocatePages:Base: Reserved=%#llx Allocated+Ballooned+Requested=%#llx+%#llx+%#x!\n",
     
    26682668    pPage->Shared.cRefs++;
    26692669    pGVM->gmm.s.cSharedPages++;
     2670    pGVM->gmm.s.Allocated.cBasePages++;
    26702671}
    26712672#endif
     
    27112712    {
    27122713        case GMMACCOUNT_BASE:
    2713             if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cSharedPages < cPages))
     2714            if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages < cPages))
    27142715            {
    27152716                Log(("gmmR0FreePages: allocated=%#llx cPages=%#x!\n", pGVM->gmm.s.Allocated.cBasePages, cPages));
     
    27432744    int rc = VINF_SUCCESS;
    27442745    uint32_t iPage;
    2745     uint32_t cSharedPages = 0;
    27462746    for (iPage = 0; iPage < cPages; iPage++)
    27472747    {
     
    27702770                Assert(pGVM->gmm.s.cSharedPages);
    27712771                pGVM->gmm.s.cSharedPages--;
    2772                 cSharedPages++;
    27732772                Assert(pPage->Shared.cRefs);
    27742773                if (!--pPage->Shared.cRefs)
     
    27912790    }
    27922791
    2793     Assert(iPage > cSharedPages);
    2794 
    27952792    /*
    27962793     * Update the account.
     
    27982795    switch (enmAccount)
    27992796    {
    2800         case GMMACCOUNT_BASE:   pGVM->gmm.s.Allocated.cBasePages   -= (iPage - cSharedPages); break;
     2797        case GMMACCOUNT_BASE:   pGVM->gmm.s.Allocated.cBasePages   -= iPage; break;
    28012798        case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages -= iPage; break;
    28022799        case GMMACCOUNT_FIXED:  pGVM->gmm.s.Allocated.cFixedPages  -= iPage; break;
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