From nobody Fri May 16 04:46:17 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1499867071117431.33736734673437; Wed, 12 Jul 2017 06:44:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE7A580082; Wed, 12 Jul 2017 13:44:26 +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 9B7186E512; Wed, 12 Jul 2017 13:44:26 +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 40BF21853E30; Wed, 12 Jul 2017 13:44:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6CDiPEv032580 for ; Wed, 12 Jul 2017 09:44:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C6BF6DACA; Wed, 12 Jul 2017 13:44:25 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 996866DA86; Wed, 12 Jul 2017 13:44:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CE7A580082 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.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 CE7A580082 From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 12 Jul 2017 15:44:06 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Nitesh Konkar Subject: [libvirt] [PATCH 5/5] qemu: process: Don't put memoryless NUMA nodes into autoNodeset 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 12 Jul 2017 13:44:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 'numad' may return a nodeset which contains NUMA nodes without memory for certain configurations. Since cgroups code will not be happy using nodes without memory we need to store only numa nodes with memory in autoNodeset. On the other hand autoCpuset should contain cpus also for nodes which do not have any memory. Reviewed-by: Andrea Bolognani --- src/qemu/qemu_process.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 01fe33c92..78c5692a0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5416,6 +5416,8 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr= vm, { qemuDomainObjPrivatePtr priv =3D vm->privateData; char *nodesetstr =3D NULL; + virBitmapPtr numadNodeset =3D NULL; + virBitmapPtr hostMemoryNodeset =3D NULL; int ret =3D -1; /* Get the advisory nodeset from numad if 'placement' of @@ -5430,20 +5432,30 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjP= tr vm, if (!nodesetstr) goto cleanup; + if (!(hostMemoryNodeset =3D virNumaGetHostMemoryNodeset())) + goto cleanup; + VIR_DEBUG("Nodeset returned from numad: %s", nodesetstr); - if (virBitmapParse(nodesetstr, &priv->autoNodeset, - VIR_DOMAIN_CPUMASK_LEN) < 0) + if (virBitmapParse(nodesetstr, &numadNodeset, VIR_DOMAIN_CPUMASK_LEN) = < 0) goto cleanup; - if (!(priv->autoCpuset =3D virCapabilitiesGetCpusForNodemask(caps, - priv->autoN= odeset))) + /* numad may return a nodeset that only contains cpus but cgroups don'= t play + * well with that. Set the autoCpuset from all cpus from that nodeset,= but + * assign autoNodeset only with nodes containing memory. */ + if (!(priv->autoCpuset =3D virCapabilitiesGetCpusForNodemask(caps, num= adNodeset))) goto cleanup; + virBitmapIntersect(numadNodeset, hostMemoryNodeset); + + VIR_STEAL_PTR(priv->autoNodeset, numadNodeset); + ret =3D 0; cleanup: VIR_FREE(nodesetstr); + virBitmapFree(numadNodeset); + virBitmapFree(hostMemoryNodeset); return ret; } --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list