VirtualBox

Changeset 43235 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Sep 6, 2012 11:53:40 PM (12 years ago)
Author:
vboxsync
Message:

GMMR0.cpp: Fixed bug in GMMR0CleanupVM/gmmR0CleanupVMScanChunk affecting bound mode on all 32-bit hosts + 64-bit darwin. Problem was caused by unncessary scanning of chunks bound to other VMs and accidentally relinking them into the set of the VM about to die. Once the GVM structure was finally fried, almost all pChunk->pSet members would point to the dead VMs GVM::gmm.s.Private member.

Also fixed a missing redo-from-start when someone else freed a chunk while we were scanning the list. Expecting this to only occure rarely, but should be reproducible when many VMs are doing cleanups at the same time in unbound mode.

File:
1 edited

Legend:

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

    r43047 r43235  
    12151215         * shared pages will be 'left behind'.)
    12161216         */
     1217        /** @todo r=bird: This scanning+freeing could be optimized in bound mode! */
    12171218        uint64_t    cPrivatePages = pGVM->gmm.s.Stats.cPrivatePages; /* save */
    12181219
     
    12261227            {
    12271228                uint32_t const cFreeChunksOld = pGMM->cFreedChunks;
    1228                 if (gmmR0CleanupVMScanChunk(pGMM, pGVM, pChunk))
     1229                if (   (   !pGMM->fBoundMemoryMode
     1230                        || pChunk->hGVM == pGVM->hSelf)
     1231                    && gmmR0CleanupVMScanChunk(pGMM, pGVM, pChunk))
    12291232                {
    12301233                    /* We left the giant mutex, so reset the yield counters. */
     
    12411244                }
    12421245                if (pGMM->cFreedChunks != cFreeChunksOld)
     1246                {
     1247                    fRedoFromStart = true;
    12431248                    break;
     1249                }
    12441250            }
    12451251        } while (fRedoFromStart);
     
    13491355static bool gmmR0CleanupVMScanChunk(PGMM pGMM, PGVM pGVM, PGMMCHUNK pChunk)
    13501356{
     1357    Assert(!pGMM->fBoundMemoryMode || pChunk->hGVM == pGVM->hSelf);
     1358
    13511359    /*
    13521360     * Look for pages belonging to the VM.
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