VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/GMMR0Internal.h@ 29455

Last change on this file since 29455 was 29424, checked in by vboxsync, 15 years ago

Shared paging updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1/* $Id: GMMR0Internal.h 29424 2010-05-12 15:11:09Z vboxsync $ */
2/** @file
3 * GMM - The Global Memory Manager, Internal Header.
4 */
5
6/*
7 * Copyright (C) 2007 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___GMMR0Internal_h
19#define ___GMMR0Internal_h
20
21#include <VBox/gmm.h>
22#include <iprt/avl.h>
23
24/**
25 * The allocation sizes.
26 */
27typedef struct GMMVMSIZES
28{
29 /** The number of pages of base memory.
30 * This is the sum of RAM, ROMs and handy pages. */
31 uint64_t cBasePages;
32 /** The number of pages for the shadow pool. (Can be sequeezed for memory.) */
33 uint32_t cShadowPages;
34 /** The number of pages for fixed allocations like MMIO2 and the hyper heap. */
35 uint32_t cFixedPages;
36} GMMVMSIZES;
37/** Pointer to a GMMVMSIZES. */
38typedef GMMVMSIZES *PGMMVMSIZES;
39
40/**
41 * Shared module registration info (per VM)
42 */
43typedef struct GMMSHAREDMODULEPERVM
44{
45 /** Tree node. */
46 AVLGCPTRNODECORE Core;
47
48 /** Pointer to global shared module info. */
49 PGMMSHAREDMODULE pGlobalModule;
50
51 /** Set if another VM registered a different shared module at the same base address. */
52 bool fCollision;
53 /** Alignment. */
54 bool bAlignment[7];
55} GMMSHAREDMODULEPERVM;
56/** Pointer to a GMMSHAREDMODULEPERVM. */
57typedef GMMSHAREDMODULEPERVM *PGMMSHAREDMODULEPERVM;
58
59/**
60 * The per-VM GMM data.
61 */
62typedef struct GMMPERVM
63{
64 /** The reservations. */
65 GMMVMSIZES Reserved;
66 /** The actual allocations.
67 * This includes both private and shared page allocations. */
68 GMMVMSIZES Allocated;
69
70 /** The current number of private pages. */
71 uint64_t cPrivatePages;
72 /** The current number of shared pages. */
73 uint64_t cSharedPages;
74 /** The current over-comitment policy. */
75 GMMOCPOLICY enmPolicy;
76 /** The VM priority for arbitrating VMs in low and out of memory situation.
77 * Like which VMs to start sequeezing first. */
78 GMMPRIORITY enmPriority;
79
80 /** The current number of ballooned pages. */
81 uint64_t cBalloonedPages;
82 /** The max number of pages that can be ballooned. */
83 uint64_t cMaxBalloonedPages;
84 /** The number of pages we've currently requested the guest to give us.
85 * This is 0 if no pages currently requested. */
86 uint64_t cReqBalloonedPages;
87 /** The number of pages the guest has given us in response to the request.
88 * This is not reset on request completed and may be used in later decisions. */
89 uint64_t cReqActuallyBalloonedPages;
90 /** The number of pages we've currently requested the guest to take back. */
91 uint64_t cReqDeflatePages;
92
93 /** Shared module tree (per-vm). */
94 PAVLGCPTRNODECORE pSharedModuleTree;
95
96 /** Whether ballooning is enabled or not. */
97 bool fBallooningEnabled;
98
99 /** Whether shared paging is enabled or not. */
100 bool fSharedPagingEnabled;
101
102 /** Whether the VM is allowed to allocate memory or not.
103 * This is used when the reservation update request fails or when the VM has
104 * been told to suspend/save/die in an out-of-memory case. */
105 bool fMayAllocate;
106} GMMPERVM;
107/** Pointer to the per-VM GMM data. */
108typedef GMMPERVM *PGMMPERVM;
109
110#endif
111
Note: See TracBrowser for help on using the repository browser.

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