From nobody Thu May 2 22:48:09 2024 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.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551889868409428.7991836214586; Wed, 6 Mar 2019 08:31:08 -0800 (PST) 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 D004581DFC; Wed, 6 Mar 2019 16:31:05 +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 05DD960E3D; Wed, 6 Mar 2019 16:31:05 +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 9B5AB181A136; Wed, 6 Mar 2019 16:31:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26GUQMH026796 for ; Wed, 6 Mar 2019 11:30:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 184045C646; Wed, 6 Mar 2019 16:30:26 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 149815C1A1; Wed, 6 Mar 2019 16:30:20 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 17:30:25 +0100 Message-Id: <1551889825-227155-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, ehabkost@redhat.com Subject: [libvirt] [PATCH] numa: warn if numa 'mem' option or default RAM splitting between nodes is used. 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 06 Mar 2019 16:31:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Ammend -numa option docs and print warnings if 'mem' option or default RAM splitting between nodes is used. It's intended to discourage users from usi= ng configuration that allows only to fake NUMA on guest side while leading to reduced performance of the guest due to inability to properly configure VM's RAM on the host. In NUMA case, it's recommended to always explicitly configure guest RAM using -numa node,memdev=3D{backend-id} option. Signed-off-by: Igor Mammedov --- numa.c | 5 +++++ qemu-options.hx | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/numa.c b/numa.c index 3875e1e..c6c2a6f 100644 --- a/numa.c +++ b/numa.c @@ -121,6 +121,8 @@ static void parse_numa_node(MachineState *ms, NumaNodeO= ptions *node, =20 if (node->has_mem) { numa_info[nodenr].node_mem =3D node->mem; + warn_report("Parameter -numa node,mem is obsolete," + " use -numa node,memdev instead"); } if (node->has_memdev) { Object *o; @@ -407,6 +409,9 @@ void numa_complete_configuration(MachineState *ms) if (i =3D=3D nb_numa_nodes) { assert(mc->numa_auto_assign_ram); mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_siz= e); + warn_report("Default splitting of RAM between nodes is obsolet= e," + " Use '-numa node,memdev' to explictly define RAM" + " allocation per node"); } =20 numa_total =3D 0; diff --git a/qemu-options.hx b/qemu-options.hx index 1cf9aac..033e311 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -206,10 +206,14 @@ For example: -numa cpu,node-id=3D0,socket-id=3D0 -numa cpu,node-id=3D1,socket-id=3D1 @end example =20 -@samp{mem} assigns a given RAM amount to a node. @samp{memdev} -assigns RAM from a given memory backend device to a node. If -@samp{mem} and @samp{memdev} are omitted in all nodes, RAM is -split equally between them. +@samp{memdev} assigns RAM from a given memory backend device to a node. + +Legacy options/behaviour: @samp{mem} assigns a given RAM amount to a node. +If @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is split equ= ally +between them. Option @samp{mem} and default RAM splitting are obsolete as = they +do not provide means to manage RAM on host side and only allow QEMU to fake +NUMA support which in practice could degrade VM performance. +It's advised to always explicitly configure NUMA RAM using @samp{memdev} o= ption. =20 @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, if one node uses @samp{memdev}, all of them have to use it. --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list