From nobody Thu May 16 04:00:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1606827423; cv=none; d=zohomail.com; s=zohoarc; b=kCmaVBgWfuRFaWQOr7F1LTBCMTaDouZJz0KgF6dcrOTmvzNx2oU0aYpfUsF/OwsmZHb21lZxlmotvtHingDQesyvnEcMm83FfrfzD4mrvpbau7OJ6WRmJbyEDWA0zxxlEGxNrw1/tq2brA9XUUPx8IH4TtnVjHhzAIstSrnVokc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606827423; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=HhqozqMzg2DBOvpZGt+obwiap+uE3S/ptDd9zWm30m8=; b=WVBhme0saa7uyeV8xs1tS7+IYqsHI891we0Ivl47m5S4cZ+JIj8Repa0l0gExRqyaf40nja38SdV2EkwxUxGCRrCWj9fq9X5hO/QRAUHhGbdXwoQ7vSyTS+q7ne/thCSzfizqN/1FfqYMJMLEWq91ck4Bjgjj4wG3B9iGE/YAa0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606827423478417.49046366330697; Tue, 1 Dec 2020 04:57:03 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-446-uRjH5RhhMnCBmIS6xwZTxw-1; Tue, 01 Dec 2020 07:57:00 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6445100B718; Tue, 1 Dec 2020 12:56:53 +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 EDEA560BE5; Tue, 1 Dec 2020 12:56:52 +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 43EC1180954D; Tue, 1 Dec 2020 12:56:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B1Csa3P002591 for ; Tue, 1 Dec 2020 07:54:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 716C55C1B4; Tue, 1 Dec 2020 12:54:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6ED65C1A3 for ; Tue, 1 Dec 2020 12:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606827422; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HhqozqMzg2DBOvpZGt+obwiap+uE3S/ptDd9zWm30m8=; b=D68iilIaSPWdQ/6v0/lDWOnELRRjl/Pq8Q/okGyO5CPo0rY7MP1HV0DY9E8TxxEtZpfX+r NAgWCOW3RfuN9omLP4Qxq2Eiw4/oE0BmTfm4/to8bFt9RtW0ZwTvqtRrUbrXzxmyQgBEAF /1KeqLfwx2BBip1XGGF62nfrd2T3NJ8= X-MC-Unique: uRjH5RhhMnCBmIS6xwZTxw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu: Recreate NUMA caps when creating connect capabilities Date: Tue, 1 Dec 2020 13:54:29 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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) Content-Type: text/plain; charset="utf-8" In v6.0.0-rc1~439 (and friends) we tried to cache NUMA capabilities because we assumed they are immutable. And to some extent they are (NUMA hotplug is not a thing, is it). However, our capabilities contain also some runtime info that can change, e.g. hugepages pool allocation sizes or total amount of memory per node (host side memory hotplug might change the value). When rebuilding virCaps (e.g. for 'virsh capabilities') we have to dropped the cached info and rebuild it from scratch so that the correct runtime info is reported. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1819058 Fixes: 1a1d848694f6c2f1d98a371124928375bc3bb4a3 Signed-off-by: Michal Privoznik --- After this, we are still caching CPU caps, but I'm not sure if that is a problem. Perhaps if CPU was hotplugged/unplugged? I don't know. src/qemu/qemu_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index d6615ca0dd..89a16349bf 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1380,6 +1380,12 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDr= iverPtr driver) "DOI \"%s\"", model, doi); } =20 + /* Forcibly recreate NUMA caps. They are not static + * (e.g. size of hugepages pools can change). */ + qemuDriverLock(driver); + g_clear_pointer(&driver->hostnuma, virCapabilitiesHostNUMAUnref); + qemuDriverUnlock(driver); + caps->host.numa =3D virQEMUDriverGetHostNUMACaps(driver); caps->host.cpu =3D virQEMUDriverGetHostCPU(driver); return g_steal_pointer(&caps); --=20 2.26.2