VirtualBox

Ignore:
Timestamp:
Sep 15, 2021 11:29:42 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146904
Message:

VMM/PGM: Some cleanups around large page allocation... bugref:10093

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp

    r91245 r91246  
    49304930 * @param   GCPhys      GC physical start address of the 2 MB range
    49314931 */
    4932 VMMR3DECL(int) PGMR3PhysAllocateLargeHandyPage(PVM pVM, RTGCPHYS GCPhys)
     4932VMMR3_INT_DECL(int) PGMR3PhysAllocateLargePage(PVM pVM, RTGCPHYS GCPhys)
    49334933{
    49344934#ifdef PGM_WITH_LARGE_PAGES
    4935     uint64_t u64TimeStamp1, u64TimeStamp2;
    4936 
    49374935    PGM_LOCK_VOID(pVM);
    49384936
    49394937    STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a);
    4940     u64TimeStamp1 = RTTimeMilliTS();
     4938    uint64_t const msAllocStart = RTTimeMilliTS();
    49414939    int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE, 0, NULL);
    4942     u64TimeStamp2 = RTTimeMilliTS();
     4940    uint64_t const cMsElapsed   = RTTimeMilliTS() - msAllocStart;
    49434941    STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a);
    49444942    if (RT_SUCCESS(rc))
     
    50125010    {
    50135011        static uint32_t cTimeOut = 0;
    5014         uint64_t u64TimeStampDelta = u64TimeStamp2 - u64TimeStamp1;
    5015 
    5016         if (u64TimeStampDelta > 100)
     5012        if (cMsElapsed > 100)
    50175013        {
    50185014            STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatLargePageOverflow);
    5019             if (    ++cTimeOut > 10
    5020                 ||  u64TimeStampDelta > 1000 /* more than one second forces an early retirement from allocating large pages. */)
     5015            if (   ++cTimeOut > 10
     5016                || cMsElapsed > 1000 /* more than one second forces an early retirement from allocating large pages. */)
    50215017            {
    50225018                /* If repeated attempts to allocate a large page takes more than 100 ms, then we fall back to normal 4k pages.
    50235019                 * E.g. Vista 64 tries to move memory around, which takes a huge amount of time.
    50245020                 */
    5025                 LogRel(("PGMR3PhysAllocateLargePage: allocating large pages takes too long (last attempt %d ms; nr of timeouts %d); DISABLE\n", u64TimeStampDelta, cTimeOut));
     5021                LogRel(("PGMR3PhysAllocateLargePage: allocating large pages takes too long (last attempt %RU64 ms; nr of timeouts %d); DISABLE\n", cMsElapsed, cTimeOut));
    50265022                PGMSetLargePageUsage(pVM, false);
    50275023            }
    50285024        }
    5029         else
    5030         if (cTimeOut > 0)
     5025        else if (cTimeOut > 0)
    50315026            cTimeOut--;
    50325027    }
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