From nobody Mon May 6 01:21:51 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1499668809544524.5677981301556; Sun, 9 Jul 2017 23:40:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DBCF4DD49; Mon, 10 Jul 2017 06:40:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D27677D4EA; Mon, 10 Jul 2017 06:40:03 +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 E84F53FADF; Mon, 10 Jul 2017 06:39:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6A6duBl029566 for ; Mon, 10 Jul 2017 02:39:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id F275B18AAB; Mon, 10 Jul 2017 06:39:55 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED75760465 for ; Mon, 10 Jul 2017 06:39:54 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1470C81227 for ; Mon, 10 Jul 2017 06:39:53 +0000 (UTC) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6A6d8hm073355 for ; Mon, 10 Jul 2017 02:39:52 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 2bjsyjty8x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Jul 2017 02:39:52 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jul 2017 16:39:48 +1000 Received: from d23relay09.au.ibm.com (202.81.31.228) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Jul 2017 16:39:47 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6A6dkuj12583028 for ; Mon, 10 Jul 2017 16:39:46 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v6A6dhLh009852 for ; Mon, 10 Jul 2017 16:39:44 +1000 Received: from dhcp-9-109-222-221.in.ibm.com ([9.124.35.65]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v6A6dgo7009823; Mon, 10 Jul 2017 16:39:42 +1000 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9DBCF4DD49 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx09.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 9DBCF4DD49 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1470C81227 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=niteshkonkar.libvirt@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1470C81227 From: Nitesh Konkar To: libvir-list@redhat.com Date: Mon, 10 Jul 2017 12:09:36 +0530 X-TM-AS-MML: disable x-cbid: 17071006-0016-0000-0000-0000025BBF57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071006-0017-0000-0000-000006DC0746 Message-Id: <20170710063936.18982-1-niteshkonkar.libvirt@gmail.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-10_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=18 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707100119 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Jul 2017 06:39:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 10 Jul 2017 06:39:53 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'niteshkonkar.libvirt@gmail.com' RCPT:'' X-RedHat-Spam-Score: -1.133 (BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_SOFTFAIL) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Nitesh Konkar , Nitesh Konkar Subject: [libvirt] [PATCH] Fix guest boot failure when vcpu placement="auto" on memoryless numa node 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 10 Jul 2017 06:40:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When the vcpu placement is auto and we have memoryless numa nodes on the ho= st, numad returns a list numa nodes with and without memory. When we try to wri= te it to /sys/fs/cgroup/*/cpuset.mems it errors out as invlaid argument. Signed-off-by: Nitesh Konkar --- numactl --hardware available: 4 nodes (0-1,16-17) node 0 cpus: 0 8 16 24 32 node 0 size: 32500 MB node 0 free: 25584 MB node 1 cpus: 40 48 56 64 72 node 1 size: 0 MB----------------------------------------------# node 1 free: 0 MB node 16 cpus: 80 88 96 104 112 node 16 size: 32613 MB node 16 free: 30991 MB node 17 cpus: 120 128 136 144 152 node 17 size: 0 MB--------------------------------------------# node 17 free: 0 MB node distances: node 0 1 16 17=20 0: 10 20 40 40=20 1: 20 10 40 40=20 16: 40 40 10 20=20 17: 40 40 20 10=20 virsh start virt-tests-vm1 error: Failed to start domain virt-tests-vm1 error: Invalid value '0-1,16-17' for 'cpuset.mems': Invalid argument-------= -------NOK src/qemu/qemu_cgroup.c | 4 +++- src/qemu/qemu_process.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 36762d4..fd8deb1 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -723,10 +723,12 @@ qemuSetupCpusetMems(virDomainObjPtr vm) { virCgroupPtr cgroup_temp =3D NULL; qemuDomainObjPrivatePtr priv =3D vm->privateData; + virBitmapPtr nodeSet =3D NULL; virDomainNumatuneMemMode mode; char *mem_mask =3D NULL; int ret =3D -1; =20 + nodeSet =3D virNumaGetHostMemoryNodeset();=20 if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET= )) return 0; =20 @@ -735,7 +737,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm) return 0; =20 if (virDomainNumatuneMaybeFormatNodeset(vm->def->numa, - priv->autoNodeset, + nodeSet, &mem_mask, -1) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index fa9990e..074a0cd 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2374,6 +2374,7 @@ qemuProcessSetupPid(virDomainObjPtr vm, virDomainNumatuneMemMode mem_mode; virCgroupPtr cgroup =3D NULL; virBitmapPtr use_cpumask; + virBitmapPtr nodeSet =3D NULL; char *mem_mask =3D NULL; int ret =3D -1; =20 @@ -2397,13 +2398,15 @@ qemuProcessSetupPid(virDomainObjPtr vm, * neither period nor quota settings. And if CPUSET controller is * not initialized either, then there's nothing to do anyway. */ + nodeSet =3D virNumaGetHostMemoryNodeset();=20 + if (virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU) || virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)= ) { =20 if (virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) =3D=3D = 0 && mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && virDomainNumatuneMaybeFormatNodeset(vm->def->numa, - priv->autoNodeset, + nodeSet, &mem_mask, -1) < 0) goto cleanup; =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list