VirtualBox

Changeset 31445 in vbox


Ignore:
Timestamp:
Aug 7, 2010 9:12:46 PM (14 years ago)
Author:
vboxsync
Message:

PGMRZDynMap.cpp: Unused hinting debugging, define PGMRZDYNMAP_STRICT_RELEASE to enable it (disabled by default).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp

    r31402 r31445  
    146146        (pEntry)->cUnrefs      = 0; \
    147147    } while (0)
     148
     149
     150/** @def PGMRZDYNMAP_STRICT_RELEASE
     151 * Define this to force pages to be released and make non-present ASAP after
     152 * use.  This should not normally be enabled as it is a bit expensive. */
     153#if 0 || defined(DOXYGEN_RUNNING)
     154# define PGMRZDYNMAP_STRICT_RELEASE
     155#endif
    148156
    149157
     
    13121320    AssertMsg(cRefs >= 0, ("%d\n", cRefs));
    13131321    if (!cRefs)
     1322    {
    13141323        pThis->cLoad--;
     1324#ifdef PGMRZDYNMAP_STRICT_RELEASE
     1325        pThis->paPages[iPage].HCPhys = NIL_RTHCPHYS;
     1326        ASMAtomicBitClear(pThis->paPages[iPage].uPte.pv, X86_PTE_BIT_P);
     1327        ASMInvalidatePage(pThis->paPages[iPage].pvPage);
     1328#endif
     1329    }
    13151330}
    13161331
     
    16151630                    cLoad++;
    16161631            }
    1617 #ifdef IN_RING0
     1632#if defined(IN_RING0) && !defined(PGMRZDYNMAP_STRICT_RELEASE)
    16181633            else
    16191634                CHECK_RET(paPages[iPage].uPte.pLegacy->u == paSavedPTEs[iPage],
     
    21422157     * Find the entry in the usual unrolled fashion.
    21432158     */
     2159    /** @todo add a hint to the set which entry was used last since it's not
     2160     *        always the last entry? */
    21442161#define IS_MATCHING_ENTRY(pSet, iEntry, pvHint) \
    21452162        (   (pSet)->aEntries[(iEntry)].pvPage == (pvHint) \
     
    22152232    else
    22162233        Log(("pgmRZDynMapUnusedHint: pvHint=%p ignored because of overflow! %s(%d) %s\n", pvHint, pszFile, iLine, pszFunction));
     2234
     2235#ifdef PGMRZDYNMAP_STRICT_RELEASE
     2236    /*
     2237     * Optimize the set to trigger the unmapping and invalidation of the page.
     2238     */
     2239    if (cUnrefs + 1 == cTotalRefs)
     2240        pgmDynMapOptimizeAutoSet(pSet);
     2241#endif
    22172242}
    22182243
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