From nobody Thu May 2 10:42:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511885840374942.8726806194835; Tue, 28 Nov 2017 08:17:20 -0800 (PST) Received: from localhost ([::1]:38749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJiZO-0006V9-IA for importer@patchew.org; Tue, 28 Nov 2017 11:17:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJiXx-0005ga-UM for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJiXr-00042S-Nn for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42968) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJiXr-000420-Eu for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:39 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0F798046F; Tue, 28 Nov 2017 16:15:38 +0000 (UTC) Received: from localhost (ovpn-116-202.ams2.redhat.com [10.36.116.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0419260C9E; Tue, 28 Nov 2017 16:15:35 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 28 Nov 2017 16:15:28 +0000 Message-Id: <20171128161529.3025-2-stefanha@redhat.com> In-Reply-To: <20171128161529.3025-1-stefanha@redhat.com> References: <20171128161529.3025-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 28 Nov 2017 16:15:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] qemu-options: document missing memory-backend-file options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , Eduardo Habkost , Stefan Hajnoczi , Hu Tao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch adds undocumented memory-backend-file options to the documentation. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eduardo Habkost Reviewed-by: Eric Blake --- qemu-options.hx | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 3728e9b4dd..f2cf0be193 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4189,18 +4189,24 @@ property must be set. These objects are placed in = the =20 @table @option =20 -@item -object memory-backend-file,id=3D@var{id},size=3D@var{size},mem-path= =3D@var{dir},share=3D@var{on|off},discard-data=3D@var{on|off} +@item -object memory-backend-file,id=3D@var{id},size=3D@var{size},mem-path= =3D@var{dir},share=3D@var{on|off},discard-data=3D@var{on|off},merge=3D@var{= on|off},dump=3D@var{on|off},prealloc=3D@var{on|off},host-nodes=3D@var{host-= nodes},policy=3D@var{default|preferred|bind|interleave} =20 Creates a memory file backend object, which can be used to back -the guest RAM with huge pages. The @option{id} parameter is a -unique ID that will be used to reference this memory region -when configuring the @option{-numa} argument. The @option{size} -option provides the size of the memory region, and accepts -common suffixes, eg @option{500M}. The @option{mem-path} provides -the path to either a shared memory or huge page filesystem mount. +the guest RAM with huge pages. + +The @option{id} parameter is a unique ID that will be used to reference th= is +memory region when configuring the @option{-numa} argument. + +The @option{size} option provides the size of the memory region, and accep= ts +common suffixes, eg @option{500M}. + +The @option{mem-path} provides the path to either a shared memory or huge = page +filesystem mount. + The @option{share} boolean option determines whether the memory region is marked as private to QEMU, or shared. The latter allows a co-operating external process to access the QEMU memory region. + Setting the @option{discard-data} boolean option to @var{on} indicates that file contents can be destroyed when QEMU exits, to avoid unnecessarily flushing data to the backing file. Note @@ -4208,6 +4214,34 @@ that @option{discard-data} is only an optimization, = and QEMU might not discard file contents if it aborts unexpectedly or is terminated using SIGKILL. =20 +The @option{merge} boolean option enables memory merge, also known as +MADV_MERGEABLE, so that Kernel Samepage Merging will consider the pages for +memory deduplication. + +Setting the @option{dump} boolean option to @var{off} excludes the memory = from +core dumps. This feature is also known as MADV_DONTDUMP. + +The @option{prealloc} boolean option enables memory preallocation. + +The @option{host-nodes} option binds the memory range to a list of NUMA ho= st +nodes. + +The @option{policy} option sets the NUMA policy to one of the following va= lues: + +@table @option +@item @var{default} +default host policy + +@item @var{preferred} +prefer the given host node list for allocation + +@item @var{bind} +restrict memory allocation to the given host node list + +@item @var{interleave} +interleave memory allocations across the given host node list +@end table + @item -object rng-random,id=3D@var{id},filename=3D@var{/dev/random} =20 Creates a random number generator backend which obtains entropy from --=20 2.14.3 From nobody Thu May 2 10:42:51 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511885980739766.5241410505769; Tue, 28 Nov 2017 08:19:40 -0800 (PST) Received: from localhost ([::1]:38758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJibN-0007xk-T4 for importer@patchew.org; Tue, 28 Nov 2017 11:19:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJiXy-0005hA-LD for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJiXu-00043u-Oj for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54634) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJiXu-00043X-I8 for qemu-devel@nongnu.org; Tue, 28 Nov 2017 11:15:42 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C21536A7C0; Tue, 28 Nov 2017 16:15:41 +0000 (UTC) Received: from localhost (ovpn-116-202.ams2.redhat.com [10.36.116.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id 117276198E; Tue, 28 Nov 2017 16:15:39 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 28 Nov 2017 16:15:29 +0000 Message-Id: <20171128161529.3025-3-stefanha@redhat.com> In-Reply-To: <20171128161529.3025-1-stefanha@redhat.com> References: <20171128161529.3025-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 28 Nov 2017 16:15:41 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] qemu-options: document memory-backend-ram X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , Eduardo Habkost , Stefan Hajnoczi , Hu Tao Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The documentation should mention -object memory-backend-ram. Suggested-by: Yumei Huang Signed-off-by: Stefan Hajnoczi Reviewed-by: Eduardo Habkost Reviewed-by: Eric Blake --- qemu-options.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index f2cf0be193..65123ae177 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4242,6 +4242,13 @@ restrict memory allocation to the given host node li= st interleave memory allocations across the given host node list @end table =20 +@item -object memory-backend-ram,id=3D@var{id},merge=3D@var{on|off},dump= =3D@var{on|off},prealloc=3D@var{on|off},size=3D@var{size},host-nodes=3D@var= {host-nodes},policy=3D@var{default|preferred|bind|interleave} + +Creates a memory backend object, which can be used to back the guest RAM. +Memory backend objects offer more control than the @option{-m} option that= is +traditionally used to define guest RAM. Please refer to +@option{memory-backend-file} for a description of the options. + @item -object rng-random,id=3D@var{id},filename=3D@var{/dev/random} =20 Creates a random number generator backend which obtains entropy from --=20 2.14.3