From nobody Wed Apr 24 01:24:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 152846062593890.7684792462992; Fri, 8 Jun 2018 05:23:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5804185A07; Fri, 8 Jun 2018 12:23:44 +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 1C1A92010D0E; Fri, 8 Jun 2018 12:23:44 +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 B5A691800FC1; Fri, 8 Jun 2018 12:23:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w58CNIHq004190 for ; Fri, 8 Jun 2018 08:23:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id D6F9F26E5C; Fri, 8 Jun 2018 12:23:18 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC9FF84562 for ; Fri, 8 Jun 2018 12:23:17 +0000 (UTC) Received: from mail-wr0-f198.google.com (mail-wr0-f198.google.com [209.85.128.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B773C8553D for ; Fri, 8 Jun 2018 12:23:16 +0000 (UTC) Received: by mail-wr0-f198.google.com with SMTP id x14-v6so7399756wrr.17 for ; Fri, 08 Jun 2018 05:23:16 -0700 (PDT) Received: from fiorina.redhat.com (ip-94-112-73-67.net.upcbroadband.cz. [94.112.73.67]) by smtp.gmail.com with ESMTPSA id x63-v6sm1987574wma.25.2018.06.08.05.23.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 05:23:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IXP4cYXAd2XC5zGf8IjCV9ln8g4of83dTsW5/h13O8I=; b=XeLNUceWNzpSzWREFDzUK6uE0JWIfXuAiXiwlN26BrmZZawMN2XQwUw48oAGuFzsc2 eiRDoIMph/yvntGyrh9FltAshyVCwf7i/TWYx55n8HiuIZbrvN5XLSPUdEiKlXUUSqBH QauL0B4PacWVvQrRZp3gMMC5BE8Rrc+v9P0DyD9p+YXgz04jH9WMkUpjHzJ6LcGfIvov 3gZagowSnM5Vf7y3DXO/ztSBwAvhIWS82+x0UohFSaj1VUr9e0mGc4g7eKIosE8r6Dzz YYKkijgwiOEiiqKkPPJvGqLLQVqnsMDtj8HGif0iu6e+hfKjU4U52+m5xwopBkDPFVF8 icCA== X-Gm-Message-State: APt69E3arE1GPWrNXz8XbhC0PZyqihwWvrZI06TM/OUk50oyHlCjr3qt 3YGmr6zXkGdS9WHGNiS1ThuW6Xhf7SaRy8yihLogRq/1W6JvTNfv71h4FpGvH1wOVX9yglwfzcF phxzDjumqjTPua544CIYR X-Received: by 2002:a1c:d287:: with SMTP id j129-v6mr1334818wmg.106.1528460595327; Fri, 08 Jun 2018 05:23:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKV43wrQpxX/FwY0cL6t7Pn/xJG8zOgB+q+UR9eQCw2hi9ixfIuvUajFDnkK8/62RTh9XtbJw== X-Received: by 2002:a1c:d287:: with SMTP id j129-v6mr1334808wmg.106.1528460595152; Fri, 08 Jun 2018 05:23:15 -0700 (PDT) From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= To: libvirt-list@redhat.com Date: Fri, 8 Jun 2018 14:23:12 +0200 Message-Id: <053baf25c5ef6b4f3d1638a0827442cae6dd993c.1528460572.git.tgolembi@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Tom=C3=A1=C5=A1=20Golembiovsk=C3=BD?= Subject: [libvirt] [PATCH v2 1/1] qemu: add entry for balloon stat stat-disk-caches 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 08 Jun 2018 12:23:44 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Signed-off-by: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD --- include/libvirt/libvirt-domain.h | 9 ++++++++- src/libvirt-domain.c | 3 +++ src/qemu/qemu_monitor_json.c | 2 ++ tools/virsh-domain-monitor.c | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index da773b76cb..b96c018a90 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -628,11 +628,18 @@ typedef enum { /* Timestamp of the last update of statistics, in seconds. */ VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE =3D 9, =20 + /* + * The amount of memory, in bytes, that can be quickly reclaimed witho= ut + * additional I/O. Typically these pages are used for caching files fr= om + * disk. + */ + VIR_DOMAIN_MEMORY_STAT_DISK_CACHES =3D 10, + /* * The number of statistics supported by this version of the interface. * To add new statistics, add them to the enum and increase this value. */ - VIR_DOMAIN_MEMORY_STAT_NR =3D 10, + VIR_DOMAIN_MEMORY_STAT_NR =3D 11, =20 # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_MEMORY_STAT_LAST =3D VIR_DOMAIN_MEMORY_STAT_NR diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index d44b553c74..ca22d13568 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -5732,6 +5732,9 @@ virDomainGetInterfaceParameters(virDomainPtr domain, * Current balloon value (in kb). * VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE * Timestamp of the last statistic + * VIR_DOMAIN_MEMORY_STAT_DISK_CACHES + * Memory that can be reclaimed without additional I/O, typically disk + * caches (in kb). * * Returns: The number of stats provided or -1 in case of failure. */ diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e8a46d2ec3..d62d979b5a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2071,6 +2071,8 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, VIR_DOMAIN_MEMORY_STAT_USABLE, 1024); GET_BALLOON_STATS(data, "last-update", VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE, 1); + GET_BALLOON_STATS(statsdata, "stat-disk-caches", + VIR_DOMAIN_MEMORY_STAT_DISK_CACHES, 1024); ret =3D got; cleanup: virJSONValueFree(cmd); diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 8cbb3db37c..bad882e87c 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -362,6 +362,8 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) vshPrint(ctl, "actual %llu\n", stats[i].val); if (stats[i].tag =3D=3D VIR_DOMAIN_MEMORY_STAT_RSS) vshPrint(ctl, "rss %llu\n", stats[i].val); + if (stats[i].tag =3D=3D VIR_DOMAIN_MEMORY_STAT_DISK_CACHES) + vshPrint(ctl, "disk_caches %llu\n", stats[i].val); if (stats[i].tag =3D=3D VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE) vshPrint(ctl, "last_update %llu\n", stats[i].val); } --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list