From nobody Sat Jul 27 02:42:21 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=1684836426; cv=none; d=zohomail.com; s=zohoarc; b=GbCJRnNmc0EioA9CeNW7OHhzbMmfl/v44F6VEWUbs4FrN5E61o7bdy2xc1DuDWDawWDXCwfCwrDWVKeaCIdCVtGInKYuiwtQnaY/6HGnmJsdKup3UKvjCqTLVLJPQst8fPypzA0CyrBBuIXICXlT3cUaA2u41+Ldv0ZKWtrAH/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684836426; 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=PdY2q/WadXp/wF5hKjLC/PWsiiY50AT5ae8sAEYMM7k=; b=EEayjoaxwm1QC2P5aymPggdHXUNgW57cJFLMKwrmXhRB+lD1RnNYvHBfKwMbd0Ko2YO85CHWzVAhRAtAoJ6O+e1EJDwDH8GfJ5Cq+5tYjNBMGPE28GuOL29utZ8ucjI1afWdqTiwhmA8KTOOAZ/uZEIsZdK/UXk45EkBC3jhWxs= 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 1684836426031876.7658091473006; Tue, 23 May 2023 03:07:06 -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-441-qGL4ChK9M8KVVdTxs7qeSQ-1; Tue, 23 May 2023 06:06:44 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1EADC185A78B; Tue, 23 May 2023 10:06: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 0DD6720296C6; Tue, 23 May 2023 10:06: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 27A4119452C7; Tue, 23 May 2023 10:06:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 86CD919465A0 for ; Tue, 23 May 2023 10:06:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 820BA112131E; Tue, 23 May 2023 10:06:25 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 299051121319 for ; Tue, 23 May 2023 10:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684836425; 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=PdY2q/WadXp/wF5hKjLC/PWsiiY50AT5ae8sAEYMM7k=; b=EvyXvCugouH7B90C8SUbaNH2wnUUpJSwGRYicY2ILR5yvqv/18uxaIgAwRqT9TEwnSEl0u 64tX+enLTFCRDqBFFUuCQLPi+yH2dC/8b/Vsfqb1lgiUCfrer+gyvtC3TMiOo4E7crTQcs m54W4ud0Q6d5TyJEYcGWXutdxBe/q5s= X-MC-Unique: qGL4ChK9M8KVVdTxs7qeSQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] qemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during mem hotplug Date: Tue, 23 May 2023 12:06:21 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 3.1 on 10.11.54.4 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: 1684836427205100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Again, this fixes the same problem as one of previous commits, but this time for memory hotplug. Long story short, if there's a domain running and the emulator thread is restricted to a subset of host NUMA nodes, but the memory that's about to be hotplugged requires memory from a host NUMA node that's not in the set we need to allow emulator thread to access the node, temporarily. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_hotplug.c | 8 ++++++++ src/qemu/qemu_process.c | 2 +- src/qemu/qemu_process.h | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d5148f5815..972df572a7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2247,6 +2247,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, bool teardownlabel =3D false; bool teardowncgroup =3D false; bool teardowndevice =3D false; + bool restoreemulatorcgroup =3D false; g_autoptr(virJSONValue) props =3D NULL; virObjectEvent *event; int id; @@ -2294,6 +2295,10 @@ qemuDomainAttachMemory(virQEMUDriver *driver, if (qemuDomainAdjustMaxMemLock(vm) < 0) goto removedef; =20 + if (qemuProcessSetupEmulator(vm, true) < 0) + goto removedef; + restoreemulatorcgroup =3D true; + qemuDomainObjEnterMonitor(vm); if (qemuMonitorAddObject(priv->mon, &props, NULL) < 0) goto exit_monitor; @@ -2333,6 +2338,9 @@ qemuDomainAttachMemory(virQEMUDriver *driver, qemuDomainReleaseMemoryDeviceSlot(vm, mem); } =20 + if (restoreemulatorcgroup) + qemuProcessSetupEmulator(vm, false); + virDomainMemoryDefFree(mem); return ret; =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0fafda0beb..803bf9b0a3 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2700,7 +2700,7 @@ qemuProcessSetupPid(virDomainObj *vm, } =20 =20 -static int +int qemuProcessSetupEmulator(virDomainObj *vm, bool unionMems) { diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index e0cbafda1d..1c4c0678ab 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -235,3 +235,6 @@ void qemuProcessCleanupMigrationJob(virQEMUDriver *driv= er, =20 void qemuProcessRefreshDiskProps(virDomainDiskDef *disk, struct qemuDomainDiskInfo *info); + +int qemuProcessSetupEmulator(virDomainObj *vm, + bool unionMems); --=20 2.39.3