Changeset 33537 in vbox for trunk/src/VBox
- Timestamp:
- Oct 28, 2010 8:49:11 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67137
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMPhys.cpp
r33508 r33537 3846 3846 { 3847 3847 #ifdef PGM_WITH_LARGE_PAGES 3848 uint64_t cbAvailableMem; 3849 3850 if ( RTSystemQueryAvailableRam(&cbAvailableMem) == VINF_SUCCESS 3851 && cbAvailableMem < (UINT64_C(2) * _1G)) 3852 { 3853 /** Too little free RAM left; don't bother as the host might try to move memory around, which is very expensive. */ 3854 LogRel(("PGMR3PhysAllocateLargeHandyPage: refuse to allocate large page; available memory on the host: %RX64\n", cbAvailableMem)); 3855 return VINF_EM_NO_MEMORY; 3856 } 3848 uint64_t u64TimeStamp1, u64TimeStamp2; 3857 3849 3858 3850 pgmLock(pVM); 3859 3851 3860 3852 STAM_PROFILE_START(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 3853 u64TimeStamp1 = RTTimeMilliTS(); 3861 3854 int rc = VMMR3CallR0(pVM, VMMR0_DO_PGM_ALLOCATE_LARGE_HANDY_PAGE, 0, NULL); 3855 u64TimeStamp2 = RTTimeMilliTS(); 3862 3856 STAM_PROFILE_STOP(&pVM->pgm.s.CTX_SUFF(pStats)->StatAllocLargePage, a); 3863 3857 if (RT_SUCCESS(rc)) … … 3926 3920 } 3927 3921 pVM->pgm.s.cLargeHandyPages = 0; 3922 } 3923 3924 if (RT_SUCCESS(rc)) 3925 { 3926 static uint32_t cTimeOut = 0; 3927 3928 if (u64TimeStamp2 - u64TimeStamp1 > 100) 3929 { 3930 if (++cTimeOut > 5) 3931 { 3932 /* If repeated attempts to allocate a large page takes more than 100 ms, then we fall back to normal 4k pages. 3933 * E.g. Vista 64 tries to move memory around, which takes a huge amount of time. 3934 */ 3935 LogRel(("PGMR3PhysAllocateLargePage: allocating large pages takes too long (last attempt %d ms); DISABLE\n", u64TimeStamp2 - u64TimeStamp1)); 3936 PGMSetLargePageUsage(pVM, false); 3937 } 3938 } 3939 else 3940 if (cTimeOut > 0) 3941 cTimeOut--; 3928 3942 } 3929 3943
Note:
See TracChangeset
for help on using the changeset viewer.