From nobody Mon Feb 9 04:45:51 2026 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=1648823930; cv=none; d=zohomail.com; s=zohoarc; b=kt53VdX6TUqaBxD8ljRihjHheNyTjIM9moayQzWbhBzh6MrsHVECGc1q8Iya3P5lmT9Jwr/WmokN+WDzQSn0i3g4s253tK04HsMcE8LVZuf9PxtRkS4STX4AEsqvdb/oqpyjC0cUUgampru3ODa4dWXz+AtanNVwes9sRVLvC5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648823930; 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=euiRI9fdG2hqOC+RemeiWiAcOcfIjui2WZFQNO39p9s=; b=lRKYHkNxmk9IjlaGT9pq74qPDmSOTJLvmabGDDQZz4YPmsIQy+aL7yNOIBgJ7bK7zlkX8mguJ9CSJlErAWn1YO76P6LXuDpfRxlvmDKujm06OywXVhz6rNhlgsgWLOJS1YCGq3Zi5iDxXySdrbog/zREJoN81IRwrJR4YITbdc4= 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 1648823930200516.2158977655048; Fri, 1 Apr 2022 07:38:50 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-cH0jgkgqNl6Yin3X02UjqA-1; Fri, 01 Apr 2022 10:38:45 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D5FA86B8B3; Fri, 1 Apr 2022 14:38:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8270063B201; Fri, 1 Apr 2022 14:38:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 605A21947BBF; Fri, 1 Apr 2022 14:38:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B186E1947BBE for ; Fri, 1 Apr 2022 14:38:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A5AE540F013; Fri, 1 Apr 2022 14:38:39 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E5AF40BAEE for ; Fri, 1 Apr 2022 14:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648823929; 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=euiRI9fdG2hqOC+RemeiWiAcOcfIjui2WZFQNO39p9s=; b=VTqwVX5SbK+xbhh+qFXJxAkzHoNr2vdEpLvwH+iCIvWSjnw/UfoGL93O0aff5mWWf18BXN yMwD+tY2lU+3tm0PlFYNRMfOutBEUtGhISMaYgy4mRbjjbRCl+t4sMIWAP16kmZt+1Pw9Y 3i4YzI07TPgMh+pAxugQZXmFeUoO9iU= X-MC-Unique: cH0jgkgqNl6Yin3X02UjqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] lib: Set up cpuset controller for restrictive numatune Date: Fri, 1 Apr 2022 16:38:35 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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: 1648823931931100011 Content-Type: text/plain; charset="utf-8"; x-default="true" The aim of 'restrictive' numatune mode is to rely solely on CGroups to have QEMU running on configured NUMA nodes. However, we were never setting the cpuset controller when a domain was starting up. We are doing so only when virDomainSetNumaParameters() is called (aka live pinning). This is obviously wrong. Fortunately, fix is simple as 'restrictive' is similar to 'strict' - every location where VIR_DOMAIN_NUMATUNE_MEM_STRICT occurs can be audited and VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE case can be added. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2070380 Signed-off-by: Michal Privoznik --- src/ch/ch_process.c | 3 ++- src/lxc/lxc_controller.c | 3 ++- src/qemu/qemu_process.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c index 785e4f8769..977082d585 100644 --- a/src/ch/ch_process.c +++ b/src/ch/ch_process.c @@ -254,7 +254,8 @@ virCHProcessSetupPid(virDomainObj *vm, 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 && + (mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT || + mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) && virDomainNumatuneMaybeFormatNodeset(vm->def->numa, priv->autoNodeset, &mem_mask, -1) < 0) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 677fa5a4fb..d936f34793 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -811,7 +811,8 @@ static int virLXCControllerSetupResourceLimits(virLXCCo= ntroller *ctrl) virDomainNumatuneMemMode mode; =20 if (virDomainNumatuneGetMode(ctrl->def->numa, -1, &mode) =3D=3D 0) { - if (mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && + if ((mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT || + mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) && virCgroupControllerAvailable(VIR_CGROUP_CONTROLLER_CPUSET)) { /* Use virNuma* API iff necessary. Once set and child is exec(= )-ed, * there's no way for us to change it. Rely on cgroups (if ava= ilable diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bd13cc5103..c4b349632e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2650,7 +2650,8 @@ qemuProcessSetupPid(virDomainObj *vm, 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 && + (mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT || + mem_mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) && virDomainNumatuneMaybeFormatNodeset(vm->def->numa, priv->autoNodeset, &mem_mask, -1) < 0) @@ -3166,7 +3167,8 @@ static int qemuProcessHook(void *data) goto cleanup; =20 if (virDomainNumatuneGetMode(h->vm->def->numa, -1, &mode) =3D=3D 0) { - if (mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT && + if ((mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_STRICT || + mode =3D=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) && h->cfg->cgroupControllers & (1 << VIR_CGROUP_CONTROLLER_CPUSET= ) && virCgroupControllerAvailable(VIR_CGROUP_CONTROLLER_CPUSET)) { /* Use virNuma* API iff necessary. Once set and child is exec(= )-ed, --=20 2.35.1