From nobody Mon Feb 9 08:56:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1490293042554286.09497002958994; Thu, 23 Mar 2017 11:17:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CAC36C0528DC; Thu, 23 Mar 2017 18:17:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 73E4317583; Thu, 23 Mar 2017 18:17:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 21DA218523C5; Thu, 23 Mar 2017 18:17:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v2NIH1Pu011521 for ; Thu, 23 Mar 2017 14:17:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3579831A5; Thu, 23 Mar 2017 18:17:01 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.34.129.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B19F831A3 for ; Thu, 23 Mar 2017 18:17:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CAC36C0528DC Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CAC36C0528DC From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 23 Mar 2017 19:16:47 +0100 Message-Id: <1490293007-27030-9-git-send-email-abologna@redhat.com> In-Reply-To: <1490293007-27030-1-git-send-email-abologna@redhat.com> References: <1490293007-27030-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 8/8] docs: Improve documentation related to memory locking X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 23 Mar 2017 18:17:21 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- docs/formatdomain.html.in | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 4a3123e..5906de6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -937,14 +937,18 @@
locked
When set and supported by the hypervisor, memory pages belonging to the domain will be locked in host's memory and the host will not - be allowed to swap them out. For QEMU/KVM this requires - hard_limit memory t= uning - element to be used and set to the maximum memory configured for the - domain plus any memory consumed by the QEMU process itself. Beware= of - setting the memory limit too high (and thus allowing the domain to= lock - most of the host's memory). Doing so may be dangerous to both the - domain and the host itself since the host's kernel may run out of - memory. Since 1.0.6
+ be allowed to swap them out, which might be required for some + workloads such as RT. For QEMU/KVM guests, the memory used by the = QEMU + process itself will be locked too: unlike guest memory, this is an + amount libvirt has no way of figuring out in advance, so it has to + remove the limit on locked memory altogether. This can be very + dangerous as the host might run out of memory and be unable to rec= laim + it from the guest, so using this option is discouraged unless your + workload demands it; even then, it's highly recommended to set an + hard_limit (see + memory tuning) on memory all= ocation + suitable for the specific environment at the same time to mitigate + the risks described above. Since 1.0.6
source
In this attribute you can switch to file memorybacking or keep = default anonymous.
access
@@ -989,12 +993,18 @@
hard_limit
The optional hard_limit element is the maximum mem= ory the guest can use. The units for this value are kibibytes (i.e. bl= ocks - of 1024 bytes). However, users of QEMU and KVM are strongly - advised not to set this limit as domain may get killed by the kern= el - if the guess is too low. To determine the memory needed for a proc= ess - to run is an + of 1024 bytes). Users of QEMU and KVM are strongly advised not to = set + this limit as domain may get killed by the kernel if the guess is = too + low, and determining the memory needed for a process to run is an - undecidable problem.
+ undecidable problem; that said, if you already set + locked in + memory backing because your + workload demands it, you'll have to take into account the specific= s of + your deployment and figure out a value for hard_limit= that + balances the risk of your guest being killed because the limit was= set + too low and the risk of your host crashing because it cannot recla= im + the memory used by the guest due to locked. Good luck= !
soft_limit
The optional soft_limit element is the memory limi= t to enforce during memory contention. The units for this value are --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list