From nobody Tue Nov 4 15:31:27 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.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 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530217603017661.2357622542927; Thu, 28 Jun 2018 13:26:43 -0700 (PDT) Received: from localhost ([::1]:38392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdV4-0008Bz-1w for importer@patchew.org; Thu, 28 Jun 2018 16:26:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYdAn-0007OQ-Cj for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYdAl-0000k3-SO for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:45 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:51039) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYdAl-0000il-LE for qemu-devel@nongnu.org; Thu, 28 Jun 2018 16:05:43 -0400 Received: by mail-wm0-x231.google.com with SMTP id e16-v6so10987541wmd.0 for ; Thu, 28 Jun 2018 13:05:43 -0700 (PDT) Received: from 640k.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 127-v6sm6211110wmd.18.2018.06.28.13.05.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 13:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=w2epYMMgupDcHFe33/shx0Ht+lrTafKP/MYgPM4y8Ws=; b=Jpu/IPpXRO9Fo5fdOEWhizGf989Celnk6DYksBunMNjzvdqv1PjSR9rt9yenOCIiWW C4EPviWoG4YvlStrddD5dRy65zgCm7pzBKhj5OiVQCLgf/MY+qEZbsqpZjPrB2kznVtm JlnHJ1KFM9ni3prNA5C05mGtSThT9bUnthgpG5+z8AuU45r/X/HUYGILnT1b3toBQYwE Ywuwo7zYl2sXFR/7HVi1GniXBdnm53xuX851BDwY3Cpewu7KE+tlF93CHRsgKYig3hy3 cs+AEDUkB+6G9aZbeyTMYM1awEJO6GWDxW6Hb7YkpX3T6bhCgpzUhb9uYjnP5AhwNWsT 1JQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=w2epYMMgupDcHFe33/shx0Ht+lrTafKP/MYgPM4y8Ws=; b=osAt0NV+fgmlkzdwCilDFKzQiK+f6Y4Bnz5bo9V3gW0Tv10cZBV8QMDWKEnGiVoyul bCsGQ0jsFpUjmufD8ZPtJap2KZOQhQvhyILGdV73bLqbsTzXNezMf7Bvx5CWnRGIDQ0Z MUI0g0/+W9a0Ygidjhko0WYjdnB3AER91lotOy90RE6DXLOfWaaVFApS7bG+lC7vqy8j MdrKEkFe1/aGAPi/EmS5wbh+mY1O1elFSfH35sKfepbgOSNZb2aECbCBohKRS+oho/ll 5Of/8Rw36aUsfoifFFXg2b+85Fc6Lxb0h9sBPSyIbUOdIlvSPrdeRAOoZcXYDl1+TVvu gvhQ== X-Gm-Message-State: APt69E3xgVJ4u94pU1GekBNrK4Q14pNhkOMXcPPEV6EUiDvQPprnAFaf Tdo+kS5SMDZgUm7mX2cvR5k9HEu/ X-Google-Smtp-Source: AAOMgpd8KoLK2uQpcVxeIla+y0g7h2pvgqfIytxnDJ66DefE6idB+HautiELJ9WnHjMQyXN7fFtiwg== X-Received: by 2002:a1c:84d0:: with SMTP id g199-v6mr9959831wmd.90.1530216342225; Thu, 28 Jun 2018 13:05:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 28 Jun 2018 22:04:39 +0200 Message-Id: <1530216310-52873-30-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> References: <1530216310-52873-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [PULL 29/60] numa: report all DIMM/NVDIMMs as plugged memory 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: David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: David Hildenbrand Right now, there is some inconsistency between hotplugged and coldplugged memory. DIMMs added via "-device" result in different stats than DIMMs added using "device_add". E.g. [...] -numa node,nodeid=3D0,cpus=3D0-1 -numa node,nodeid=3D1,cpus=3D2-3 \ -m 4G,maxmem=3D20G,slots=3D2 \ -object memory-backend-ram,id=3Dmem0,size=3D8G \ -device pc-dimm,id=3Ddimm0,memdev=3Dmem0 \ -object memory-backend-ram,id=3Dmem1,size=3D8G \ -device nvdimm,id=3Ddimm1,memdev=3Dmem1,node=3D1 Results in NUMA info (qemu) info numa info numa 2 nodes node 0 cpus: 0 1 node 0 size: 10240 MB node 0 plugged: 0 MB node 1 cpus: 2 3 node 1 size: 10240 MB node 1 plugged: 0 MB But in memory size summary: (qemu) info memory_size_summary info memory_size_summary base memory: 4294967296 plugged memory: 17179869184 Make this consistent by reporting all hot and coldplugged memory a.k.a. DIMM and NVDIMM as "plugged". Fixes: 31959e82fb0 ("hmp: extend "info numa" with hotplugged memory informa= tion") Signed-off-by: David Hildenbrand Message-Id: <20180622144045.737-1-david@redhat.com> Signed-off-by: Paolo Bonzini --- numa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/numa.c b/numa.c index 94f758c..5f6367b 100644 --- a/numa.c +++ b/numa.c @@ -566,10 +566,8 @@ static void numa_stat_memory_devices(NumaNodeMem node_= mem[]) =20 if (pcdimm_info) { node_mem[pcdimm_info->node].node_mem +=3D pcdimm_info->siz= e; - if (pcdimm_info->hotpluggable && pcdimm_info->hotplugged) { - node_mem[pcdimm_info->node].node_plugged_mem +=3D - pcdimm_info->size; - } + node_mem[pcdimm_info->node].node_plugged_mem +=3D + pcdimm_info->size; } } } --=20 1.8.3.1