VirtualBox

Changeset 82990 in vbox for trunk


Ignore:
Timestamp:
Feb 5, 2020 11:43:13 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
136002
Message:

VMM/GMMR0: Added TLB statistics for GMMR0PageIdToVirt. bugref:9627

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/vm.h

    r82968 r82990  
    14351435    } cfgm;
    14361436
     1437    /** Statistics for ring-0 only components. */
     1438    struct
     1439    {
     1440        /** GMMR0 stats. */
     1441        struct
     1442        {
     1443            /** Chunk TLB hits. */
     1444            uint64_t    cChunkTlbHits;
     1445            /** Chunk TLB misses. */
     1446            uint64_t    cChunkTlbMisses;
     1447        } gmm;
     1448        uint64_t    au64Padding[6];     /* probably more comming here... */
     1449    } R0Stats;
     1450
    14371451    /** Padding for aligning the structure size on a page boundrary. */
    1438     uint8_t         abAlignment2[664 - 64 + 256 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
     1452    uint8_t         abAlignment2[600 - 64 + 256 - sizeof(PVMCPUR3) * VMM_MAX_CPU_COUNT];
    14391453
    14401454    /* ---- end small stuff ---- */
  • trunk/include/VBox/vmm/vm.mac

    r82968 r82990  
    137137    .vm                     resb 32
    138138    .cfgm                   resb 8
     139    .R0Stats                resb 64
    139140
    140     .abAlignment2           resb 664 - 64 + 256 - RTR0PTR_CB * VMM_MAX_CPU_COUNT
     141    .abAlignment2           resb 600 - 64 + 256 - RTR0PTR_CB * VMM_MAX_CPU_COUNT
    141142
    142143    alignb RTR0PTR_CB * VMM_MAX_CPU_COUNT ; ASSUMES VMM_MAX_CPU_COUNT is a power of two.
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r82989 r82990  
    45584558        && pTlbe->idGeneration == ASMAtomicUoReadU64(&pGMM->idFreeGeneration)
    45594559        && pChunk->Core.Key    == idChunk)
    4560     { /* hopeful outcome */ }
     4560        pGVM->R0Stats.gmm.cChunkTlbHits++; /* hopefully this is a likely outcome */
    45614561    else
    45624562    {
     4563        pGVM->R0Stats.gmm.cChunkTlbMisses++;
     4564
     4565        /*
     4566         * Look it up in the chunk tree.
     4567         */
    45634568        RTSpinlockAcquire(pGMM->hSpinLockTree);
    45644569        pChunk = gmmR0GetChunkLocked(pGMM, idChunk);
  • trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h

    r82989 r82990  
    107107    /** Spinlock protecting the chunk lookup TLB. */
    108108    RTSPINLOCK          hChunkTlbSpinLock;
     109    uint64_t            cChunkTlbHits;
     110    uint64_t            cChunkTlbMisses;
    109111    /** The chunk lookup TLB used by GMMR0PageIdToVirt. */
    110112    GMMPERVMCHUNKTLBE   aChunkTlbEntries[GMMPERVM_CHUNKTLB_ENTRIES];
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r82968 r82990  
    836836    STAM_REG(pVM, &pUVM->vm.s.StatReqPushBackRaces, STAMTYPE_COUNTER,  "/VM/Req/PushBackRaces",  STAMUNIT_OCCURENCES,        "Number of push back races.");
    837837
     838    /* Statistics for ring-0 components: */
     839    STAM_REL_REG(pVM, &pVM->R0Stats.gmm.cChunkTlbHits,   STAMTYPE_COUNTER, "/GMM/ChunkTlbHits",   STAMUNIT_OCCURENCES, "GMMR0PageIdToVirt chunk TBL hits");
     840    STAM_REL_REG(pVM, &pVM->R0Stats.gmm.cChunkTlbMisses, STAMTYPE_COUNTER, "/GMM/ChunkTlbMisses", STAMUNIT_OCCURENCES, "GMMR0PageIdToVirt chunk TBL misses");
     841
    838842    /*
    839843     * Init all R3 components, the order here might be important.
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