summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-05-18 20:49:25 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2015-05-18 20:49:25 +0000
commit36780da73e29e6fd2e0ac9560f4d1cc447cc82af (patch)
treecffa0afdbb944c7b47173e7c823d93ce70ed2d8d
parent0eb5a23ae51b8b5c99a5176a52f81c097d925895 (diff)
balloon: document deflate on oom
Document the new option, and also clarify behaviour without it. In particular, I noticed that actual field is not the actual number of pages in the balloon as driver might do inflate followed by deflate. Also, device isn't always driven by interrupts, driver can inflate/deflate in response to e.g. memory compaction. VIRTIO-126 Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio/branches/v1.0@527 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rw-r--r--content.tex31
1 files changed, 27 insertions, 4 deletions
diff --git a/content.tex b/content.tex
index b1cd7bf..9f65748 100644
--- a/content.tex
+++ b/content.tex
@@ -4390,6 +4390,9 @@ guest memory statistics to the host.
\item[VIRTIO_BALLOON_F_STATS_VQ (1)] A virtqueue for reporting guest
memory statistics is present.
+\item[VIRTIO_BALLOON_F_DEFLATE_ON_OOM (2) ] Deflate balloon on
+ guest out of memory condition.
+
\end{description}
\drivernormative{\subsubsection}{Feature bits}{Device Types / Memory Balloon Device / Feature bits}
@@ -4449,8 +4452,10 @@ The device initialization process is outlined below:
\subsection{Device Operation}\label{sec:Device Types / Memory Balloon Device / Device Operation}
-The device is driven by the receipt of a
-configuration change interrupt.
+The device is driven either by the receipt of a configuration
+change interrupt, or by changing guest memory needs, such as
+performing memory compaction or responding to out of memory
+conditions.
\begin{enumerate}
\item \field{num_pages} configuration field is examined. If this is
@@ -4489,10 +4494,25 @@ requests by using the descriptor.
\drivernormative{\subsubsection}{Device Operation}{Device Types / Memory Balloon Device / Device Operation}
The driver SHOULD supply pages to the balloon when \field{num_pages} is
-greater than \field{actual}.
+greater than the actual number of pages in the balloon.
The driver MAY use pages from the balloon when \field{num_pages} is
-less than \field{actual}.
+less than the actual number of pages in the balloon.
+
+The driver MAY supply pages to the balloon when \field{num_pages} is
+greater than or equal to the actual number of pages in the balloon.
+
+If VIRTIO_BALLOON_F_DEFLATE_ON_OOM has not been negotiated, the
+driver MUST NOT use pages from the balloon when \field{num_pages}
+is less than or equal to the actual number of pages in the
+balloon.
+
+If VIRTIO_BALLOON_F_DEFLATE_ON_OOM has been negotiated, the
+driver MAY use pages from the balloon when \field{num_pages}
+is less than or equal to the actual number of pages in the
+balloon if this is required for system stability
+(e.g. if memory is required by applications running within
+ the guest).
The driver MUST use the deflateq to inform the device of pages that it
wants to use from the balloon.
@@ -4517,6 +4537,9 @@ request.
The driver MUST update \field{actual} after changing the number
of pages in the balloon.
+The driver MAY update \field{actual} once after multiple
+inflate and deflate operations.
+
\devicenormative{\subsubsection}{Device Operation}{Device Types / Memory Balloon Device / Device Operation}
The device MAY modify the contents of a page in the balloon