From nobody Fri Nov 7 15:21:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548273923786287.86992758425765; Wed, 23 Jan 2019 12:05:23 -0800 (PST) Received: from localhost ([127.0.0.1]:40951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmOm2-0000Kk-NY for importer@patchew.org; Wed, 23 Jan 2019 15:05:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmOjl-0007DE-Tx for qemu-devel@nongnu.org; Wed, 23 Jan 2019 15:03:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmOdV-0002lZ-Uu for qemu-devel@nongnu.org; Wed, 23 Jan 2019 14:56:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36586) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmOdV-0002b9-OP; Wed, 23 Jan 2019 14:56:33 -0500 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 AD47E806B6; Wed, 23 Jan 2019 19:56:17 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 063895D6A9; Wed, 23 Jan 2019 19:56:08 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Wed, 23 Jan 2019 20:55:26 +0100 Message-Id: <20190123195527.29575-9-david@redhat.com> In-Reply-To: <20190123195527.29575-1-david@redhat.com> References: <20190123195527.29575-1-david@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.26]); Wed, 23 Jan 2019 19:56:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFCv2 8/9] numa: Handle virtio-pmem in NUMA stats X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Murilo Opsfelder Araujo , Collin Walling , Eduardo Habkost , "Michael S . Tsirkin" , Cornelia Huck , David Hildenbrand , "Dr . David Alan Gilbert" , Markus Armbruster , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Igor Mammedov , David Gibson , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Account the memory to node 0 for now. Once (if ever) virtio-pmem supports NUMA, we can account it to the right node. Signed-off-by: David Hildenbrand --- numa.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/numa.c b/numa.c index 50ec016013..f426e00d06 100644 --- a/numa.c +++ b/numa.c @@ -548,6 +548,7 @@ static void numa_stat_memory_devices(NumaNodeMem node_m= em[]) MemoryDeviceInfoList *info_list =3D qmp_memory_device_list(); MemoryDeviceInfoList *info; PCDIMMDeviceInfo *pcdimm_info; + VirtioPMEMDeviceInfo *vpi; =20 for (info =3D info_list; info; info =3D info->next) { MemoryDeviceInfo *value =3D info->value; @@ -555,22 +556,21 @@ static void numa_stat_memory_devices(NumaNodeMem node= _mem[]) if (value) { switch (value->type) { case MEMORY_DEVICE_INFO_KIND_DIMM: - pcdimm_info =3D value->u.dimm.data; - break; - case MEMORY_DEVICE_INFO_KIND_NVDIMM: - pcdimm_info =3D value->u.nvdimm.data; - break; - - default: - pcdimm_info =3D NULL; - break; - } - - if (pcdimm_info) { + pcdimm_info =3D value->type =3D=3D MEMORY_DEVICE_INFO_KIND= _DIMM ? + value->u.dimm.data : value->u.nvdimm.data; node_mem[pcdimm_info->node].node_mem +=3D pcdimm_info->siz= e; node_mem[pcdimm_info->node].node_plugged_mem +=3D pcdimm_info->size; + break; + case MEMORY_DEVICE_INFO_KIND_VIRTIO_PMEM: + vpi =3D value->u.virtio_pmem.data; + /* TODO: once we support numa, assign to right node */ + node_mem[0].node_mem +=3D vpi->size; + node_mem[0].node_plugged_mem +=3D vpi->size; + break; + default: + g_assert_not_reached(); } } } --=20 2.17.2