VirtualBox

Changeset 104886 in vbox


Ignore:
Timestamp:
Jun 11, 2024 2:29:28 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163488
Message:

VMM/PGM: Tweaked the RAM range TLB hashing and quadrupled the size to improve the hit rate. bugref:10687

Location:
trunk
Files:
4 edited

Legend:

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

    r104885 r104886  
    138138        struct PGMR0PERVCPU s;
    139139#endif
    140         uint8_t             padding[192];
     140        uint8_t             padding[576];
    141141    } pgmr0;
    142142
    143143    /** Padding the structure size to page boundrary. */
    144144#ifdef VBOX_WITH_NEM_R0
    145     uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024 - 64 - 896 - 192];
     145    uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024 - 64 - 896 - 576];
    146146#else
    147     uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024      - 896 - 192];
     147    uint8_t                 abPadding3[16384 - 64*2 - 256 - 1024      - 896 - 576];
    148148#endif
    149149} GVMCPU;
     
    265265        struct PGMR0PERVM   s;
    266266#endif
    267         uint8_t             padding[89728];
     267        uint8_t             padding[90112];
    268268    } pgmr0;
    269269
     
    310310    /** Padding so aCpus starts on a page boundrary.  */
    311311#ifdef VBOX_WITH_NEM_R0
    312     uint8_t         abPadding2[16384*7 - 64 - 4352 - 1024 - 256 - 256 - 64 - 3008 - 89728 - 512 - 64 - 1024 - 192 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     312    uint8_t         abPadding2[16384*7 - 64 - 4352 - 1024 - 256 - 256 - 64 - 3008 - 90112 - 512 - 64 - 1024 - 192 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
    313313#else
    314     uint8_t         abPadding2[16384*7 - 64 - 4352 - 1024 - 256 -       64 - 3008 - 89728 - 512 - 64 - 1024 - 192 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
     314    uint8_t         abPadding2[16384*7 - 64 - 4352 - 1024 - 256 -       64 - 3008 - 90112 - 512 - 64 - 1024 - 192 - 704 - sizeof(PGVMCPU) * VMM_MAX_CPU_COUNT];
    315315#endif
    316316
  • trunk/include/VBox/vmm/gvm.mac

    r104885 r104886  
    6464        .vmmr0              resb 896
    6565        alignb 64
    66         .pgmr0              resb 192
     66        .pgmr0              resb 576
    6767        alignb 16384
    6868endstruc
     
    9595        .pdmr0              resb 3008
    9696        alignb 64
    97         .pgmr0              resb 89728
     97        .pgmr0              resb 90112
    9898        alignb 64
    9999        .iomr0              resb 512
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r104885 r104886  
    8787    AssertCompile(sizeof(pGVM->pgm.s) <= sizeof(pGVM->pgm.padding));
    8888    AssertCompile(sizeof(pGVM->pgmr0.s) <= sizeof(pGVM->pgmr0.padding));
     89    AssertCompile(sizeof(pGVM->aCpus[0].pgm.s) <= sizeof(pGVM->aCpus[0].pgm.padding));
     90    AssertCompile(sizeof(pGVM->aCpus[0].pgmr0.s) <= sizeof(pGVM->aCpus[0].pgmr0.padding));
    8991
    9092    /* Set the RAM range memory handles to NIL. */
  • trunk/src/VBox/VMM/include/PGMInternal.h

    r104885 r104886  
    14131413/** The number of entries in the RAM range TLBs (there is one for each
    14141414 *  context).  Must be a power of two. */
    1415 #define PGM_RAMRANGE_TLB_ENTRIES            16
     1415#define PGM_RAMRANGE_TLB_ENTRIES            64
    14161416
    14171417/**
     
    14211421 * @param   a_GCPhys    The guest physical address.
    14221422 */
    1423 #define PGM_RAMRANGE_TLB_IDX(a_GCPhys)      ( ((a_GCPhys) >> 20) & (PGM_RAMRANGE_TLB_ENTRIES - 1) )
     1423#define PGM_RAMRANGE_TLB_IDX(a_GCPhys)      ( ((a_GCPhys) >> 19) & (PGM_RAMRANGE_TLB_ENTRIES - 1) )
    14241424
    14251425/**
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