From nobody Mon May 6 18:22:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639583661; cv=none; d=zohomail.com; s=zohoarc; b=fcBIOb4aj5DJqix40iQ1dp27PSfHOSPTDP6C5Lhk1rAlnjebploUmn4sPiw3hZEAeUjfaxtyDXRBFXd5gWvre0ELu3NRRjRZ9iIqbiIzFiZQOF6cxLVJhVwVZ68xiMbap+SWU2V6wSudigKAk2wIcFVkWMlodabFtYbL/fC7T1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639583661; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hEa5CgHGpuWzSAzA1PG1VDSC8ka5CTCRtFpCpQ6uXgQ=; b=gBvyM2+yOk1awYFmy93lli2wYprCt0YPN4QMvNNGzwy8d/4WbHd6ZpxQjpqYYlMZtIRkbzZ0cj7U8qO/0p5YyNDBAjmOLFc0D/7nq/9CTJuZdP0GkogWoS4IEI2HGhHs2lrdLRZrC/34kD49qGySabyJSG8NR7oA65qwy19NCnc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1639583661426503.4344681168117; Wed, 15 Dec 2021 07:54:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-301-jFUYZJIOOtuOJNAdzRJE7w-1; Wed, 15 Dec 2021 10:54:16 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0AD89801B2A; Wed, 15 Dec 2021 15:54:11 +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 E12115BE14; Wed, 15 Dec 2021 15:54:10 +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 ADEB81809CB9; Wed, 15 Dec 2021 15:54:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BFFqrBn009297 for ; Wed, 15 Dec 2021 10:52:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2EF9360CC9; Wed, 15 Dec 2021 15:52:53 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.34.247.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FE84610A7 for ; Wed, 15 Dec 2021 15:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639583660; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hEa5CgHGpuWzSAzA1PG1VDSC8ka5CTCRtFpCpQ6uXgQ=; b=KiIaWnjZWq+RXpK8X6O0z5rytHEBXofm5BuLjuTgSI5CZbq5woY5WdbrlBYaMp3c2H1flG tJsKlqXVDXRGrXXS55hJfru2unlkXOVXxlqDHzCHUWwYZA6tq3w62X2odJh1rXP9RndFrO 80EaX2hkLXMZ6UIJEnpCY1RbHfz/Re0= X-MC-Unique: jFUYZJIOOtuOJNAdzRJE7w-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu: Allow VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE in qemuDomainSetNumaParamsLive() Date: Wed, 15 Dec 2021 16:52:12 +0100 Message-Id: <5674d858b0f8faf1103d5b266b0a7801f464245b.1639583509.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639583662975100005 Content-Type: text/plain; charset="utf-8" The whole idea of VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE is that the memory location is restricted only via CGroups and thus can be changed on the fly (which is exactly what qemuDomainSetNumaParamsLive() does. Allow this mode there then. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bae8b7c39b..e884dde721 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8777,10 +8777,10 @@ qemuDomainSetNumaParamsLive(virDomainObj *vm, size_t i =3D 0; =20 if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) =3D=3D 0 && - mode !=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT) { + mode !=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && + mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("change of nodeset for running domain " - "requires strict numa mode")); + _("change of nodeset for running domain requires st= rict or restrictive numa mode")); return -1; } =20 --=20 2.32.0 From nobody Mon May 6 18:22:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.151.124 as permitted sender) client-ip=170.10.151.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.151.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639583588; cv=none; d=zohomail.com; s=zohoarc; b=J27/MkvZquBm0oGPrLDTInsRBLONwD1DKK0a8oqSJ0R4TNP/0PvdF0nC/Kue0iBDFyh0DohehYLe2YfWnkrEF2uBxrCJ6Sfji5fpDq3dgUn1jUN53GIOKNreuGH2OHIWSCM09X64vhc6nPTzr/2i1RilEn4dGYDgXqQlS+lw48s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639583588; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7d6sT2PD9n+Lz1qqbR0e3m9mycDkfCwQYjczoQQ6pu4=; b=O0zKHx/89YPmM8SiQPnwgFlq2/A2lM2tCkx3QdHdqEQ4zR6w3Uv/euFiYNmQ3YsFdiWb6IHOs2a8FqJn964z3h4Mslu9fRX/i65dEq+ZXNZRS1xPrDRoV0bNkXoz4hunabpzZ/Z2CSFIUJxfwUtDwXBucFQSjMUIs0CzVhVvRaQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.151.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.151.124]) by mx.zohomail.com with SMTPS id 16395835884381016.8180639014142; Wed, 15 Dec 2021 07:53:08 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-2-oOk8stzhNQCDRHaaLAdljQ-1; Wed, 15 Dec 2021 10:53:03 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 52F3410151E1; Wed, 15 Dec 2021 15:52:58 +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 C6C2F610A7; Wed, 15 Dec 2021 15:52:57 +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 E5E821809CB8; Wed, 15 Dec 2021 15:52:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BFFqsYD009303 for ; Wed, 15 Dec 2021 10:52:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 39EB318A58; Wed, 15 Dec 2021 15:52:54 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.34.247.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9288860CC9 for ; Wed, 15 Dec 2021 15:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639583587; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7d6sT2PD9n+Lz1qqbR0e3m9mycDkfCwQYjczoQQ6pu4=; b=PLhe/DausNNlQ+r5kS/PIMYL4f0HKG+ALXQ812MaHJRY3RRIsI5JdyK/ytuySa6/WLI69c HrWEO6zy73D1q2PTGithTHZbdYC91dSnhMa27IzOYjCumpuVn9Gveqg6NjxutG2MlPdUe/ q7Xcjiqqfl/IwFqLMXIPLJVls5MCwvo= X-MC-Unique: oOk8stzhNQCDRHaaLAdljQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] qemu: Explicitly forbid changing nodeset for strict numatune Date: Wed, 15 Dec 2021 16:52:13 +0100 Message-Id: <13c05a078589d84c14cef7b5772fbde647ee69b2.1639583509.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639583589489100001 Content-Type: text/plain; charset="utf-8" Let's imagine a guest that's configured with strict numatune: For guests with NUMA: Depending on machine type used (see commit v6.4.0-rc1~75) we generate either: 1) -object '{"qom-type":"memory-backend-ram","id":"ram-node0",\ "size":20971520,"host-nodes":[0],"policy":"preferred"}' \ -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 or 2) -numa node,nodeid=3D0,cpus=3D0,mem=3D20480 Later, when QEMU boots up and cpuset CGroup controller is available we further restrict QEMU there too. But there's a behaviour difference hidden: while in case 1) QEMU is restricted from beginning, in case 2) it is not and thus it may happen that it will allocate memory from different NUMA node and even though CGroup will try to migrate it, it may fail to do so (e.g. because memory is locked). Therefore, one can argue that case 2) is broken. NB, case 2) is exactly what mode 'restrictive' is for. However, in case 1) we are unable to update QEMU with new host-nodes, simply because it's lacking a command to do so. For guests without NUMA: It's very close to case 2) from above. We have commit v7.10.0-rc1~163 that prevents us from outputting host-nodes when generating memory-backend-* for system memory, but that simply allows QEMU to allocate memory anywhere and then relies on CGroups to move it to desired location. Due to all of this, there is no reliable way to change nodeset for mode 'strict'. Let's forbid it. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e884dde721..0354e1474c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8777,10 +8777,9 @@ qemuDomainSetNumaParamsLive(virDomainObj *vm, size_t i =3D 0; =20 if (virDomainNumatuneGetMode(vm->def->numa, -1, &mode) =3D=3D 0 && - mode !=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("change of nodeset for running domain requires st= rict or restrictive numa mode")); + _("change of nodeset for running domain requires re= strictive numa mode")); return -1; } =20 @@ -8913,17 +8912,31 @@ qemuDomainSetNumaParameters(virDomainPtr dom, goto endjob; } =20 - if (nodeset && - qemuDomainSetNumaParamsLive(vm, nodeset) < 0) - goto endjob; + if (mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT) { + virBitmap *config_nodeset =3D NULL; =20 - if (virDomainNumatuneSet(def->numa, - def->placement_mode =3D=3D - VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, - -1, mode, nodeset) < 0) - goto endjob; + if (virDomainNumatuneMaybeGetNodeset(def->numa, priv->autoNode= set, + &config_nodeset, -1) < 0) + goto endjob; =20 - qemuDomainSaveStatus(vm); + if (!virBitmapEqual(nodeset, config_nodeset)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("can't change nodeset for strict mode for= running domain")); + goto endjob; + } + } else { + if (nodeset && + qemuDomainSetNumaParamsLive(vm, nodeset) < 0) + goto endjob; + + if (virDomainNumatuneSet(def->numa, + def->placement_mode =3D=3D + VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, + -1, mode, nodeset) < 0) + goto endjob; + + qemuDomainSaveStatus(vm); + } } =20 if (persistentDef) { --=20 2.32.0 From nobody Mon May 6 18:22:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1639583717; cv=none; d=zohomail.com; s=zohoarc; b=Zbvp6axV7p2/kzkJwEFEORCIsPdTOQce/ugc4h3TQWrGZy32yBz9WgnkAm/SrsXtmmEsCG48dwzVewj1K5srFOJVpK4YEMisVXctAhc7UIydGtuLSxrBf/QYeyn8n6cOCIpiIFuBOf51yjHAmb+//xf0LQn9LDhu4uS1dVt/I2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639583717; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dM0Ik4Ih/nwriOXOSNZDLnl90nVh/l/JIDZZ+vjjOCY=; b=m1R+/O3mC/ROhLs4FoNcqUdjWqI6vAvIVJ7hyE8kjR3bPXSkupYmx9b1JiX4XS9mb/zqTqJKH+jOvuhhFl5J+K99QYAaaPXppPX11cyClWVjNeyRCdn1IHR47EpwvnczXfT84q5yECXF++DgU2q7satmmeH8jtD4GCAWgnC4MOs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639583717832526.4931929478442; Wed, 15 Dec 2021 07:55:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-47-Fhs1Y2SnM7iPHmyHMU3pGg-1; Wed, 15 Dec 2021 10:54:21 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AFAF1006AAD; Wed, 15 Dec 2021 15:54:13 +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 6C05A60CC9; Wed, 15 Dec 2021 15:54:13 +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 3EBEE1809CBF; Wed, 15 Dec 2021 15:54:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BFFqtMb009308 for ; Wed, 15 Dec 2021 10:52:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 44550610AE; Wed, 15 Dec 2021 15:52:55 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.34.247.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DC64610A7 for ; Wed, 15 Dec 2021 15:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639583716; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dM0Ik4Ih/nwriOXOSNZDLnl90nVh/l/JIDZZ+vjjOCY=; b=Pk1EwWACWR1vThrAEL24lB7PlA3TYFMxvi206aYYQYgOVnSYvg5U0Fr4II2dJoyefBDVDO hyUJjAA4KGDW0+8vo7Dwt+JzaZPDrGoOGekKw8PLsdS9qAeQDwwhTPWakrAIhONdpqeitv rxGuuzOcyxTh1CPNngZYphJye1iqqNQ= X-MC-Unique: Fhs1Y2SnM7iPHmyHMU3pGg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/3] qemu_command: do use host-nodes for system memory Date: Wed, 15 Dec 2021 16:52:14 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639583719198100001 Content-Type: text/plain; charset="utf-8" After previous commit, it's no longer possible to change nodeset for strict numatune. Therefore, we can start generating host-nodes onto command line again. This partially reverts d73265af6ec41104c20633b5c0a23688a62105e6. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 3 +-- .../qemuxml2argvdata/numatune-system-memory.x86_64-latest.args | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6d00105b24..b554f4f025 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3906,8 +3906,7 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPro= ps, /* If mode is "restrictive", we should only use cgroups setting allowe= d memory * nodes, and skip passing the host-nodes and policy parameters to QEM= U command * line which means we will use system default memory policy. */ - if (!systemMemory && nodemask && - mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { + if (nodemask && mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { if (!virNumaNodesetIsAvailable(nodemask)) return -1; if (virJSONValueObjectAdd(&props, diff --git a/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.ar= gs b/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args index 2c1180b77e..fd93abe3eb 100644 --- a/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args +++ b/tests/qemuxml2argvdata/numatune-system-memory.x86_64-latest.args @@ -14,7 +14,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -accel tcg \ -cpu qemu64 \ -m 214 \ --object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"= host-nodes":[0],"policy":"bind"}' \ -overcommit mem-lock=3Doff \ -smp 2,sockets=3D2,cores=3D1,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --=20 2.32.0