From nobody Sat Oct 25 11:10:45 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; 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=oracle.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521499013442577.246529831139; Mon, 19 Mar 2018 15:36:53 -0700 (PDT) Received: from localhost ([::1]:44359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey3Oa-0006y6-UT for importer@patchew.org; Mon, 19 Mar 2018 18:36:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey3NV-0006PA-5m for qemu-devel@nongnu.org; Mon, 19 Mar 2018 18:35:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey3NS-0000mL-08 for qemu-devel@nongnu.org; Mon, 19 Mar 2018 18:35:41 -0400 Received: from hqdc-proxy-mwg015-o.oracle.com ([148.87.23.18]:41308 helo=jhdev.us.oracle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey3NR-0000lj-Ps for qemu-devel@nongnu.org; Mon, 19 Mar 2018 18:35:37 -0400 Received: by jhdev.us.oracle.com (Postfix, from userid 1001) id D3A02425BFB37; Mon, 19 Mar 2018 15:35:34 -0700 (PDT) From: Jonathan Helman To: mst@redhat.com Date: Mon, 19 Mar 2018 15:28:49 -0700 Message-Id: <1521498529-26762-1-git-send-email-jonathan.helman@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 148.87.23.18 Subject: [Qemu-devel] [PATCH v2] virtio-balloon: add hugetlb page allocation counts 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: virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, Jonathan Helman Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemu should read and report hugetlb page allocation counts exported in the following kernel patch: commit 4c3ca37c4a4394978fd0f005625f6064ed2b9a64 Author: Jonathan Helman Date: Mon Mar 19 11:00:35 2018 -0700 virtio_balloon: export hugetlb page allocation counts Export the number of successful and failed hugetlb page allocations via the virtio balloon driver. These 2 counts come directly from the vm_events HTLB_BUDDY_PGALLOC and HTLB_BUDDY_PGALLOC_FAIL. Signed-off-by: Jonathan Helman --- docs/virtio-balloon-stats.txt | 2 ++ hw/virtio/virtio-balloon.c | 2 ++ include/standard-headers/linux/virtio_balloon.h | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/virtio-balloon-stats.txt b/docs/virtio-balloon-stats.txt index 7a66d25..9985e1d 100644 --- a/docs/virtio-balloon-stats.txt +++ b/docs/virtio-balloon-stats.txt @@ -34,6 +34,8 @@ which will return a dictionary containing: - stat-total-memory - stat-available-memory - stat-disk-caches + - stat-htlb-pgalloc + - stat-htlb-pgfail =20 o A key named last-update, which contains the last stats update timestamp in seconds. Since this timestamp is generated by the host, diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index f456cea..1f7a87f 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -52,6 +52,8 @@ static const char *balloon_stat_names[] =3D { [VIRTIO_BALLOON_S_MEMTOT] =3D "stat-total-memory", [VIRTIO_BALLOON_S_AVAIL] =3D "stat-available-memory", [VIRTIO_BALLOON_S_CACHES] =3D "stat-disk-caches", + [VIRTIO_BALLOON_S_HTLB_PGALLOC] =3D "stat-htlb-pgalloc", + [VIRTIO_BALLOON_S_HTLB_PGFAIL] =3D "stat-htlb-pgfail", [VIRTIO_BALLOON_S_NR] =3D NULL }; =20 diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/stan= dard-headers/linux/virtio_balloon.h index 7b0a41b..e446805 100644 --- a/include/standard-headers/linux/virtio_balloon.h +++ b/include/standard-headers/linux/virtio_balloon.h @@ -53,7 +53,9 @@ struct virtio_balloon_config { #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ #define VIRTIO_BALLOON_S_AVAIL 6 /* Available memory as in /proc */ #define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ -#define VIRTIO_BALLOON_S_NR 8 +#define VIRTIO_BALLOON_S_HTLB_PGALLOC 8 /* Hugetlb page allocations */ +#define VIRTIO_BALLOON_S_HTLB_PGFAIL 9 /* Hugetlb page allocation failu= res */ +#define VIRTIO_BALLOON_S_NR 10 =20 /* * Memory statistics structure. --=20 1.8.3.1