Changeset 91246 in vbox for trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
- Timestamp:
- Sep 15, 2021 11:29:42 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146904
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r91245 r91246 4930 4930 * @param GCPhys GC physical start address of the 2 MB range 4931 4931 */ 4932 VMMR3 DECL(int) PGMR3PhysAllocateLargeHandyPage(PVM pVM, RTGCPHYS GCPhys)4932 VMMR3_INT_DECL(int) PGMR3PhysAllocateLargePage(PVM pVM, RTGCPHYS GCPhys) 4933 4933 { 4934 4934 #ifdef PGM_WITH_LARGE_PAGES 4935 uint64_t u64TimeStamp1, u64TimeStamp2;4936 4937 4935 PGM_LOCK_VOID(pVM); 4938 4936 4939 4937 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 4940 u 64TimeStamp1= RTTimeMilliTS();4938 uint64_t const msAllocStart = RTTimeMilliTS(); 4941 4939 int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE, 0, NULL); 4942 u 64TimeStamp2 = RTTimeMilliTS();4940 uint64_t const cMsElapsed = RTTimeMilliTS() - msAllocStart; 4943 4941 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 4944 4942 if (RT_SUCCESS(rc)) … … 5012 5010 { 5013 5011 static uint32_t cTimeOut = 0; 5014 uint64_t u64TimeStampDelta = u64TimeStamp2 - u64TimeStamp1; 5015 5016 if (u64TimeStampDelta > 100) 5012 if (cMsElapsed > 100) 5017 5013 { 5018 5014 STAM_COUNTER_INC(&pVM->pgm.s.CTX_SUFF(pStats)->StatLargePageOverflow); 5019 if ( 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. */) 5021 5017 { 5022 5018 /* If repeated attempts to allocate a large page takes more than 100 ms, then we fall back to normal 4k pages. 5023 5019 * E.g. Vista 64 tries to move memory around, which takes a huge amount of time. 5024 5020 */ 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)); 5026 5022 PGMSetLargePageUsage(pVM, false); 5027 5023 } 5028 5024 } 5029 else 5030 if (cTimeOut > 0) 5025 else if (cTimeOut > 0) 5031 5026 cTimeOut--; 5032 5027 }
Note:
See TracChangeset
for help on using the changeset viewer.