1.\" $NetBSD: viomb.4,v 1.4 2020/08/24 19:27:36 ryoon Exp $ 2.\" 3.\" Copyright (C) 2011 Minoura Makoto. 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd August 25, 2020 28.Dt VIOMB 4 29.Os 30.Sh NAME 31.Nm viomb 32.Nd VirtIO memory ballooning driver 33.Sh SYNOPSIS 34.Cd "virtio* at pci? dev ? function ?" 35.Cd "viomb* at virtio?" 36.Sh DESCRIPTION 37.Xr virtio 4 38defines an interface for efficient, standard, and extensible I/O between 39the hypervisor and the virtual machine. 40The 41.Nm 42driver supports the virtio-compliant memory ballooning device. 43.Pp 44Memory ballooning works as follows: 45.Pp 46.Bl -enum -compact 47.It 48The host operator requests a guest to return some amount of memory to the host 49(via e.g. Qemu monitor balloon command). 50.It 51The hypervisor sends the request via VirtIO memory ballooning device. 52.It 53The guest 54.Nm 55driver requests allocation of that amount of physical memory from the 56.Nx 57memory management system. 58.It 59The 60.Nm 61device tells the hypervisor the guest physical memory address of the 62allocated memory via VirtIO memory ballooning device. 63.El 64.Pp 65The sysctl node 66.Li hw.viomb.npages 67shows the requested number of memory pages to return to the hypervisor, while 68.Li hw.viomb.actual 69shows the actual number of memory pages that are already returned to the hypervisor. 70.Sh SEE ALSO 71.Xr virtio 4 , 72.Xr sysctl 8 , 73.Xr x86/balloon 4 74.Pp 75.Rs 76.%A Rusty Russell, IBM Corporation 77.%T Virtio PCI Card Specification 78.%U http://ozlabs.org/~rusty/virtio-spec/ 79.Re 80.Sh HISTORY 81The 82.Nm 83device driver appeared in 84.Nx 6.0 . 85.Sh BUGS 86The userland interface should be same as the Xen ballooning device. 87