From nobody Thu May 2 01:42:37 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 ARC-Seal: i=1; a=rsa-sha256; t=1554819150; cv=none; d=zoho.com; s=zohoarc; b=mLqLc1wy5KtP7Mw/a7WglwuGzGWf5vhoXHSOGZVGFAg0gM3Z7L2H1EIYEIVjdDkyoD//eaL+J0Emg2+0fXJHUM2zxwwct/DUPSUAYeGjSCPODTwWX2yMTXZTWM1GBI6bnhhvpujk2GBbUHp60gN8JttE6DuZFHSyEvxby85BZhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554819150; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=ao1e+SC/gxfTn8henOAo6PnNq6HnHEcAflA4f4ffYA0=; b=iJOAjzMwwLZacItWmZl9RWagNaypqk72svk6T80JUol3RSUzgHUv+l/Nfz0aWBx4Ohic0O8QIckxdjpBTukeMF39MfnU633s+u3NbpOIMlxIHTI1vXXliYkY4oJ4YzxBsSF0mnFo7sHlB9EcduzVfPsmZNKY8KEidA9QvGv8wuA= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554819150331999.1523973507269; Tue, 9 Apr 2019 07:12:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 73C4D307D764; Tue, 9 Apr 2019 14:12:28 +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 479A819C7B; Tue, 9 Apr 2019 14:12:28 +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 EE41B3FB30; Tue, 9 Apr 2019 14:12:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39EAji0020985 for ; Tue, 9 Apr 2019 10:10:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id C71401992A; Tue, 9 Apr 2019 14:10:45 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 250B619C7F; Tue, 9 Apr 2019 14:10:44 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:10:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com Subject: [libvirt] [PATCH 1/4] qemuSetupCpusetMems: Use VIR_AUTOFREE() 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 09 Apr 2019 14:12:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There is one string that can be VIR_AUTOFREE used on. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index c23f0af2aa..689e0839cd 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -830,7 +830,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm) virCgroupPtr cgroup_temp =3D NULL; qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainNumatuneMemMode mode; - char *mem_mask =3D NULL; + VIR_AUTOFREE(char *) mem_mask =3D NULL; int ret =3D -1; =20 if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET= )) @@ -843,7 +843,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm) if (virDomainNumatuneMaybeFormatNodeset(vm->def->numa, priv->autoNodeset, &mem_mask, -1) < 0) - goto cleanup; + return -1; =20 if (mem_mask) if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0, @@ -853,7 +853,6 @@ qemuSetupCpusetMems(virDomainObjPtr vm) =20 ret =3D 0; cleanup: - VIR_FREE(mem_mask); virCgroupFree(&cgroup_temp); return ret; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:42:37 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 ARC-Seal: i=1; a=rsa-sha256; t=1554819160; cv=none; d=zoho.com; s=zohoarc; b=Cq5NXT8pVbFp/EvjRsToJIsCTJphGpnL0uJTkG86SRnztuHUAtmcSZ04YGSphVuSqstBUiGZzbgcffv6W/0CDPAzJhKDBCe9HbnMgIJCwYW+m8aXdrJ7aeU8Y1gUFgR+jqWCa4j+7bhV2M4cXtdps8GE8Wy1sx5PTh798aB9gRo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554819160; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=RWbZDASsrG6z9kazNAdOhZlrILykNiKMAW3pSkk0bRc=; b=ExoAnHwM4+wdgIY1WarhBitr+2T5JcArWTDYnhLCZw2sMSl5XDNs0uPZ/l65rsryk3J4UBHKB43j4AHQb4CAvq37inAli3+NP90l9sW0n3FL2TgJpILz7Qy9vtJugfi9gGvCyoxJfoUnAC7isXGE5ryPPBNDcJoS8j6cycNvRGY= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15548191605221013.0853591004764; Tue, 9 Apr 2019 07:12:40 -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 E6734300519C; Tue, 9 Apr 2019 14:12:33 +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 B6A0E5D72F; Tue, 9 Apr 2019 14:12:33 +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 6320A181AC90; Tue, 9 Apr 2019 14:12:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39EAkUF020993 for ; Tue, 9 Apr 2019 10:10:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id BCB3E19C7F; Tue, 9 Apr 2019 14:10:46 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D1F919C7B; Tue, 9 Apr 2019 14:10:45 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:10:36 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com Subject: [libvirt] [PATCH 2/4] qemuSetupCpusetMems: Create EMULATOR thread upfront 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: , 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.49]); Tue, 09 Apr 2019 14:12:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This function is going to be called after fork() and before exec() of qemu to ensure that 'strict' mode of numatune is honored. This point is far before qemuProcessSetupEmulator() is called and thus CGroup for EMULATOR thread does not exist yet. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 689e0839cd..2c663aca0a 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -847,7 +847,7 @@ qemuSetupCpusetMems(virDomainObjPtr vm) =20 if (mem_mask) if (virCgroupNewThread(priv->cgroup, VIR_CGROUP_THREAD_EMULATOR, 0, - false, &cgroup_temp) < 0 || + true, &cgroup_temp) < 0 || virCgroupSetCpusetMems(cgroup_temp, mem_mask) < 0) goto cleanup; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:42:37 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 ARC-Seal: i=1; a=rsa-sha256; t=1554819143; cv=none; d=zoho.com; s=zohoarc; b=cCDCguKojVaSxtT989Gu+6t14IMIkTU/fuimO9HeJP4rSDMVZfCZHEUf/u/vYGcEGNh3KdO4quOSji/slFpTP6sKrTY0kw0iiAOv1k/sPyGhh2FbPaq4fNnd6NzijCUlsWVYN1q5d0bolqqvOCotiKyPrCaLJPuBQRuv1J1D574= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554819143; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=CRhRAKN+mpqt+g6os7k8JvbYANov2uhDU7rWlkjh42g=; b=ZK29wypzeuC55eg6pjKzcCanKhppe1hTJjJhJ0R03riRmdjbAb4nLPGfyH4akdNBB1Fu/SXze11XthQ8wPbKyd4s7Kp0S6LlPdwsuOWlV9bHunIZnTiiNa2TGpV4aEk/r1mG8nACO+EMdGdApZqoP0/7yUCUi7HoCWSwBmJSfzs= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554819143565524.1103033628801; Tue, 9 Apr 2019 07:12:23 -0700 (PDT) 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 1D16BC08E293; Tue, 9 Apr 2019 14:12:18 +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 A247C619B5; Tue, 9 Apr 2019 14:12:14 +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 5F77E3FB15; Tue, 9 Apr 2019 14:12:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39EAlms021000 for ; Tue, 9 Apr 2019 10:10:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id B47C71992A; Tue, 9 Apr 2019 14:10:47 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1640119C7B; Tue, 9 Apr 2019 14:10:46 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:10:37 +0200 Message-Id: <3efdba58c4d8a39b20f2a2d568533466f904315d.1554818578.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com Subject: [libvirt] [PATCH 3/4] qemu_cgroup: Make qemuSetupCpusetMems static 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: , 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.31]); Tue, 09 Apr 2019 14:12:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This function is not used (nor going to be used) outside of qemu_cgroup.c file. Mark it as static. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 2 +- src/qemu/qemu_cgroup.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 2c663aca0a..b2d300b419 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -824,7 +824,7 @@ qemuSetupDevicesCgroup(virDomainObjPtr vm) } =20 =20 -int +static int qemuSetupCpusetMems(virDomainObjPtr vm) { virCgroupPtr cgroup_temp =3D NULL; diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index dc6d173fce..88ad4a38b6 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -61,7 +61,6 @@ int qemuConnectCgroup(virDomainObjPtr vm); int qemuSetupCgroup(virDomainObjPtr vm, size_t nnicindexes, int *nicindexes); -int qemuSetupCpusetMems(virDomainObjPtr vm); int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, unsigned long long period, long long quota); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:42:37 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 ARC-Seal: i=1; a=rsa-sha256; t=1554819150; cv=none; d=zoho.com; s=zohoarc; b=VGHQH6KbPkolAxW+dMBfxyPY+7l91q7RcfPZlVJY0lDRqPuHiLcPvAjE8jdUW6CBlCG+jpX4zJP0tYlvdr4cNBQtESXJxcdYPdUnIeT//HemZxHSV17MnV3/pM/G1Uv65ijeYUQOWCFHuwevHsYEykr/TQaWeJinQUkyZsTpggU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554819150; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=PmO54sSGnYEszLlsvew7YUgkEJ7609Fyyvc/MfiHJRw=; b=EV9X/09yOJteZnLlOVzMIAm3wEb/V4I9eNTHk2OHH+datE4zA5ty55xfcBr/tOOYoxDsoXGYTioQI5t4YS3/dmLPwZNosyvyDbtxwRtoXqN/1zY/Ys90MA8G8Q00O61tJhk3y+AqyvXpN9SoXKKqo7DV0Z6BpLj3thxls8PYMyo= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554819150370725.2099743041761; Tue, 9 Apr 2019 07:12:30 -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 77A48306641B; Tue, 9 Apr 2019 14:12:28 +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 3F5B918A99; Tue, 9 Apr 2019 14:12:28 +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 E201B181AC8F; Tue, 9 Apr 2019 14:12:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x39EAmW6021006 for ; Tue, 9 Apr 2019 10:10:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC1A21992A; Tue, 9 Apr 2019 14:10:48 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0ECA419C7B; Tue, 9 Apr 2019 14:10:47 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 9 Apr 2019 16:10:38 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: mkletzan@redhat.com Subject: [libvirt] [PATCH 4/4] qemuSetupCpusetCgroup: Set up cpuset.mems before execing qemu 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: , 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.41]); Tue, 09 Apr 2019 14:12:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" It's funny how this went unnoticed for such a long time. Long story short, if a domain is configured with VIR_DOMAIN_NUMATUNE_MEM_STRICT libvirt doesn't really honour that. This is because of 7e72ac787848 after which libvirt allowed qemu to allocate memory just anywhere and only after that it used some magic involving cpuset.memory_migrate and cpuset.mems to move the memory to desired NUMA nodes. This was done in order to work around some KVM bug where KVM would fail if there wasn't a DMA zone available on the NUMA node. Well, while the work around might stopped libvirt tickling the KVM bug it also caused a bug on libvirt side: if there is not enough memory on configured NUMA node(s) then any attempt to start a domain must fail. Because of the way we play with guest memory domains can start just happily. Signed-off-by: Michal Privoznik --- src/qemu/qemu_cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index b2d300b419..d6c982aeed 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -869,6 +869,9 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm) if (virCgroupSetCpusetMemoryMigrate(priv->cgroup, true) < 0) return -1; =20 + if (qemuSetupCpusetMems(vm) < 0) + return -1; + return 0; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list