VirtualBox

Changeset 33507 in vbox for trunk/src


Ignore:
Timestamp:
Oct 27, 2010 1:31:39 PM (14 years ago)
Author:
vboxsync
Message:

Fail large page allocation if there's less than 2 GB memory free on the host.

File:
1 edited

Legend:

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

    r32307 r33507  
    3939#include <iprt/thread.h>
    4040#include <iprt/string.h>
     41#include <iprt/system.h>
    4142
    4243
     
    38443845VMMR3DECL(int) PGMR3PhysAllocateLargeHandyPage(PVM pVM, RTGCPHYS GCPhys)
    38453846{
     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        return VINF_EM_NO_MEMORY;
     3855    }
     3856
    38463857    pgmLock(pVM);
    38473858
     
    39183929    pgmUnlock(pVM);
    39193930    return rc;
     3931#else
     3932    return VERR_NOT_IMPLEMENTED;
     3933#endif /* PGM_WITH_LARGE_PAGES */
    39203934}
    39213935
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette