From patchwork Wed Jun 10 11:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11597627 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10150138C for ; Wed, 10 Jun 2020 11:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA2DD2072E for ; Wed, 10 Jun 2020 11:55:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a1VZUERH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgFJLzn (ORCPT ); Wed, 10 Jun 2020 07:55:43 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:48951 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728825AbgFJLzn (ORCPT ); Wed, 10 Jun 2020 07:55:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591790142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q646sUohGiaUOuqh4dFa0vnY8G1fxPWotwWGJuhM3Gg=; b=a1VZUERHVVyEPcV5sEU/YHslbHybnOXukxGnhA2RY5LAheInMs7aeJXSxuCWzd0d2GnxSe X0KbgDzQJ/y5kAzjBt+44XBrhWQcdq0PMUF7cyK1KfjopFlsm6x67AbJL2rYtD2d1AwFZe 0MvKZThAFqdAu6+Tm/AI17heS1w1HqI= 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-327-zqAp5p9cM8qZNzUbrb8Wlg-1; Wed, 10 Jun 2020 07:55:41 -0400 X-MC-Unique: zqAp5p9cM8qZNzUbrb8Wlg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFFC01B18BC0; Wed, 10 Jun 2020 11:55:39 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-42.ams2.redhat.com [10.36.114.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id E748A5D9D3; Wed, 10 Jun 2020 11:55:34 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-s390x@nongnu.org, Richard Henderson , Paolo Bonzini , "Dr . David Alan Gilbert" , Eduardo Habkost , "Michael S . Tsirkin" , David Hildenbrand , Pankaj Gupta , Marcel Apfelbaum Subject: [PATCH v4 14/21] numa: Handle virtio-mem in NUMA stats Date: Wed, 10 Jun 2020 13:54:12 +0200 Message-Id: <20200610115419.51688-15-david@redhat.com> In-Reply-To: <20200610115419.51688-1-david@redhat.com> References: <20200610115419.51688-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Account the memory to the configured nid. Reviewed-by: Pankaj Gupta Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbrand --- hw/core/numa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/core/numa.c b/hw/core/numa.c index 316bc50d75..06960918e7 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -812,6 +812,7 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[]) MemoryDeviceInfoList *info; PCDIMMDeviceInfo *pcdimm_info; VirtioPMEMDeviceInfo *vpi; + VirtioMEMDeviceInfo *vmi; for (info = info_list; info; info = info->next) { MemoryDeviceInfo *value = info->value; @@ -832,6 +833,11 @@ static void numa_stat_memory_devices(NumaNodeMem node_mem[]) node_mem[0].node_mem += vpi->size; node_mem[0].node_plugged_mem += vpi->size; break; + case MEMORY_DEVICE_INFO_KIND_VIRTIO_MEM: + vmi = value->u.virtio_mem.data; + node_mem[vmi->node].node_mem += vmi->size; + node_mem[vmi->node].node_plugged_mem += vmi->size; + break; default: g_assert_not_reached(); }