VirtualBox

Changeset 37803 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Jul 6, 2011 2:45:27 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72682
Message:

GMM: Don't ignore the status code of the update loop. PGM: Initialize the handy pages correctly and retry the handy page allocation a little differently.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r37251 r37803  
    26572657                                /* else: NIL_RTHCPHYS nothing */
    26582658
    2659                                 paPages[iPage].idPage = NIL_GMM_PAGEID;
     2659                                paPages[iPage].idPage       = NIL_GMM_PAGEID;
    26602660                                paPages[iPage].HCPhysGCPhys = NIL_RTHCPHYS;
    26612661                            }
     
    27222722                    }
    27232723                }
     2724            } /* for each page to update */
     2725
     2726            if (RT_SUCCESS(rc))
     2727            {
     2728#if 0  /* This appears to spell trouble... weird. */
     2729                for (iPage = 0; iPage < cPagesToAlloc; iPage++)
     2730                {
     2731                    Assert(paPages[iPage].HCPhysGCPhys  == NIL_RTHCPHYS);
     2732                    Assert(paPages[iPage].idPage        == NIL_GMM_PAGEID);
     2733                    Assert(paPages[iPage].idSharedPage  == NIL_GMM_PAGEID);
     2734                }
     2735#endif
     2736
     2737                /*
     2738                 * Join paths with GMMR0AllocatePages for the allocation.
     2739                 * Note! gmmR0AllocateMoreChunks may leave the protection of the mutex!
     2740                 */
     2741#if 0  /* Trying to reproduce out of memory issue... */
     2742                if (!cPagesToUpdate)
     2743#endif
     2744                    rc = gmmR0AllocatePagesNew(pGMM, pGVM, cPagesToAlloc, paPages, GMMACCOUNT_BASE);
     2745#if 0  /* Trying to reproduce out of memory issue... */
     2746                else
     2747                {
     2748                    for (iPage = 0; iPage < cPagesToAlloc; iPage++)
     2749                    {
     2750                        paPages[iPage].HCPhysGCPhys  = NIL_RTHCPHYS;
     2751                        paPages[iPage].idPage        = NIL_GMM_PAGEID;
     2752                        paPages[iPage].idSharedPage  = NIL_GMM_PAGEID;
     2753                    }
     2754
     2755                    rc = VERR_GMM_HIT_VM_ACCOUNT_LIMIT;
     2756                }
     2757#endif
    27242758            }
    2725 
    2726             /*
    2727              * Join paths with GMMR0AllocatePages for the allocation.
    2728              * Note! gmmR0AllocateMoreChunks may leave the protection of the mutex!
    2729              */
    2730             rc = gmmR0AllocatePagesNew(pGMM, pGVM, cPagesToAlloc, paPages, GMMACCOUNT_BASE);
    27312759        }
    27322760        else
  • trunk/src/VBox/VMM/VMMR0/PGMR0.cpp

    r37582 r37803  
    55
    66/*
    7  * Copyright (C) 2007-2010 Oracle Corporation
     7 * Copyright (C) 2007-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    121121            do
    122122            {
    123                 cPages >>= 2;
     123                cPages >>= 1;
    124124                if (cPages + iFirst < PGM_HANDY_PAGES_MIN)
    125125                    cPages = PGM_HANDY_PAGES_MIN - iFirst;
    126                 rc = GMMR0AllocateHandyPages(pVM, pVCpu->idCpu, cPages, cPages, &pVM->pgm.s.aHandyPages[iFirst]);
     126                rc = GMMR0AllocateHandyPages(pVM, pVCpu->idCpu, 0, cPages, &pVM->pgm.s.aHandyPages[iFirst]);
    127127            } while (   (   rc == VERR_GMM_HIT_GLOBAL_LIMIT
    128128                         || rc == VERR_GMM_HIT_VM_ACCOUNT_LIMIT)
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