[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XENBUS PATCH v3 1/2] Use Windows 10 APIs to inflate/deflate balloon



On 12/06/2025 12:00, Tu Dinh wrote:
Currently the balloon driver allocates pages as normal memory, which
causes Windows to report the ballooned memory as kernel-allocated
instead of unavailable.

Windows 10 provides MM_ALLOCATE_AND_HOT_REMOVE to remove pages from
the physical memory pool. The removed pages can be added back with
MmAddPhysicalMemory.

Using this feature, the real VM memory capacity will be correctly
reported in Task Manager.

Balloon deflation is implemented using calls to MmAddPhysicalMemory on
contiguous PFN ranges.

Note that MM_ALLOCATE_AND_HOT_REMOVE actually removes the pages from
memory space, so the resulting MDL will have the MDL_IO_SPACE flag;
similarly, when probing the freed MDL on deflation, we'll also have to
set MDL_IO_SPACE.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
v3: Fix the issue where hot-removed memory will be in I/O space.
v2: Updated commit message to say what the patch does. No code change.
---
  src/xenbus/balloon.c | 43 ++++++++++++++++++++++++++++++++++++++-----
  1 file changed, 38 insertions(+), 5 deletions(-)


How much testing has this had? v3 came out of nowhere.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.