[{"id":1805673,"web_url":"http://patchwork.ozlabs.org/comment/1805673/","msgid":"<181C9C1B-9119-4B1D-8327-0C5EFD42A5F5@redhat.com>","list_archive_url":null,"date":"2017-11-16T13:38:21","subject":"Re: [Qemu-devel] [virtio-dev] [PATCH 1/1] virtio-balloon: include\n\tbuffers and chached memory statistics","submitter":{"id":2865,"url":"http://patchwork.ozlabs.org/api/people/2865/","name":"Yan Vugenfirer","email":"yvugenfi@redhat.com"},"content":"Hello All,\n\nMichael asked me to comment regarding the possibility to get this statistics on Windows.\nBy using Win32_OperatingSystem WMI class we can calculate the amount of cached memory (https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx <https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx> http://brandonlive.com/2010/02/21/measuring-memory-usage-in-windows-7/ <http://brandonlive.com/2010/02/21/measuring-memory-usage-in-windows-7/>), but Windows doesn’t let to distinguish between “cached and buffers” as far as I see. \n\nBest regards,\nYan.\n\n> On 20 Sep 2017, at 19:05, Tomáš Golembiovský <tgolembi@redhat.com> wrote:\n> \n> Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>\n> ---\n> hw/virtio/virtio-balloon.c                      | 2 ++\n> include/standard-headers/linux/virtio_balloon.h | 4 +++-\n> 2 files changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c\n> index a705e0ec55..0434784c14 100644\n> --- a/hw/virtio/virtio-balloon.c\n> +++ b/hw/virtio/virtio-balloon.c\n> @@ -49,6 +49,8 @@ static const char *balloon_stat_names[] = {\n>    [VIRTIO_BALLOON_S_MEMFREE] = \"stat-free-memory\",\n>    [VIRTIO_BALLOON_S_MEMTOT] = \"stat-total-memory\",\n>    [VIRTIO_BALLOON_S_AVAIL] = \"stat-available-memory\",\n> +   [VIRTIO_BALLOON_S_BUFFERS] = \"stat-linux-buffers\",\n> +   [VIRTIO_BALLOON_S_CACHED] = \"stat-linux-cached\",\n>    [VIRTIO_BALLOON_S_NR] = NULL\n> };\n> \n> diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h\n> index 9d06ccd066..d61efbfcee 100644\n> --- a/include/standard-headers/linux/virtio_balloon.h\n> +++ b/include/standard-headers/linux/virtio_balloon.h\n> @@ -52,7 +52,9 @@ struct virtio_balloon_config {\n> #define VIRTIO_BALLOON_S_MEMFREE  4   /* Total amount of free memory */\n> #define VIRTIO_BALLOON_S_MEMTOT   5   /* Total amount of memory */\n> #define VIRTIO_BALLOON_S_AVAIL    6   /* Available memory as in /proc */\n> -#define VIRTIO_BALLOON_S_NR       7\n> +#define VIRTIO_BALLOON_S_BUFFERS  7   /* Buffers memory as in /proc */\n> +#define VIRTIO_BALLOON_S_CACHED   8   /* Cached memory as in /proc */\n> +#define VIRTIO_BALLOON_S_NR       9\n> \n> /*\n>  * Memory statistics structure.\n> -- \n> 2.14.1\n> \n> \n> ---------------------------------------------------------------------\n> To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org\n> For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yd2QV52zNz9s1h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 17 Nov 2017 00:38:57 +1100 (AEDT)","from localhost ([::1]:40956 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eFKNZ-00007Q-Sw\n\tfor incoming@patchwork.ozlabs.org; Thu, 16 Nov 2017 08:38:53 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:54295)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <yvugenfi@redhat.com>) id 1eFKNE-00006x-MK\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 08:38:34 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <yvugenfi@redhat.com>) id 1eFKNB-00027F-Bq\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 08:38:32 -0500","from mx1.redhat.com ([209.132.183.28]:54116)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <yvugenfi@redhat.com>) id 1eFKNB-00025U-30\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 08:38:29 -0500","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 0BD88356E7;\n\tThu, 16 Nov 2017 13:38:28 +0000 (UTC)","from [10.35.206.24] (unknown [10.35.206.24])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 5020860603;\n\tThu, 16 Nov 2017 13:38:24 +0000 (UTC)"],"From":"Yan Vugenfirer <yvugenfi@redhat.com>","Message-Id":"<181C9C1B-9119-4B1D-8327-0C5EFD42A5F5@redhat.com>","Mime-Version":"1.0 (Mac OS X Mail 10.3 \\(3273\\))","Date":"Thu, 16 Nov 2017 15:38:21 +0200","In-Reply-To":"<13ca7e373615efac74661590527067ee8966f027.1505923516.git.tgolembi@redhat.com>","To":"=?utf-8?b?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= <tgolembi@redhat.com>","References":"<cover.1505923516.git.tgolembi@redhat.com>\n\t<13ca7e373615efac74661590527067ee8966f027.1505923516.git.tgolembi@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tThu, 16 Nov 2017 13:38:28 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Content-Type":"text/plain;\n\tcharset=utf-8","Content-Transfer-Encoding":"quoted-printable","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [virtio-dev] [PATCH 1/1] virtio-balloon: include\n\tbuffers and chached memory statistics","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"virtio-dev@lists.oasis-open.org, Wei Wang <wei.w.wang@intel.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, \"Michael S. Tsirkin\" <mst@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1805701,"web_url":"http://patchwork.ozlabs.org/comment/1805701/","msgid":"<20171116150733.2dccc760@fiorina>","list_archive_url":null,"date":"2017-11-16T14:07:33","subject":"Re: [Qemu-devel] [virtio-dev] [PATCH 1/1] virtio-balloon: include\n\tbuffers and chached memory statistics","submitter":{"id":69377,"url":"http://patchwork.ozlabs.org/api/people/69377/","name":"Tomáš Golembiovský","email":"tgolembi@redhat.com"},"content":"On Thu, 16 Nov 2017 15:38:21 +0200\nYan Vugenfirer <yvugenfi@redhat.com> wrote:\n\n> Hello All,\n> \n> Michael asked me to comment regarding the possibility to get this statistics on Windows.\n> By using Win32_OperatingSystem WMI class we can calculate the amount of cached memory (https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx <https://msdn.microsoft.com/en-us/library/aa394239(v=vs.85).aspx> http://brandonlive.com/2010/02/21/measuring-memory-usage-in-windows-7/ <http://brandonlive.com/2010/02/21/measuring-memory-usage-in-windows-7/>), but Windows doesn’t let to distinguish between “cached and buffers” as far as I see. \n\nThanks for the input, Yan. That's definitely good to know.\n\n    Tomas\n\n> \n> Best regards,\n> Yan.\n> \n> > On 20 Sep 2017, at 19:05, Tomáš Golembiovský <tgolembi@redhat.com> wrote:\n> > \n> > Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>\n> > ---\n> > hw/virtio/virtio-balloon.c                      | 2 ++\n> > include/standard-headers/linux/virtio_balloon.h | 4 +++-\n> > 2 files changed, 5 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c\n> > index a705e0ec55..0434784c14 100644\n> > --- a/hw/virtio/virtio-balloon.c\n> > +++ b/hw/virtio/virtio-balloon.c\n> > @@ -49,6 +49,8 @@ static const char *balloon_stat_names[] = {\n> >    [VIRTIO_BALLOON_S_MEMFREE] = \"stat-free-memory\",\n> >    [VIRTIO_BALLOON_S_MEMTOT] = \"stat-total-memory\",\n> >    [VIRTIO_BALLOON_S_AVAIL] = \"stat-available-memory\",\n> > +   [VIRTIO_BALLOON_S_BUFFERS] = \"stat-linux-buffers\",\n> > +   [VIRTIO_BALLOON_S_CACHED] = \"stat-linux-cached\",\n> >    [VIRTIO_BALLOON_S_NR] = NULL\n> > };\n> > \n> > diff --git a/include/standard-headers/linux/virtio_balloon.h b/include/standard-headers/linux/virtio_balloon.h\n> > index 9d06ccd066..d61efbfcee 100644\n> > --- a/include/standard-headers/linux/virtio_balloon.h\n> > +++ b/include/standard-headers/linux/virtio_balloon.h\n> > @@ -52,7 +52,9 @@ struct virtio_balloon_config {\n> > #define VIRTIO_BALLOON_S_MEMFREE  4   /* Total amount of free memory */\n> > #define VIRTIO_BALLOON_S_MEMTOT   5   /* Total amount of memory */\n> > #define VIRTIO_BALLOON_S_AVAIL    6   /* Available memory as in /proc */\n> > -#define VIRTIO_BALLOON_S_NR       7\n> > +#define VIRTIO_BALLOON_S_BUFFERS  7   /* Buffers memory as in /proc */\n> > +#define VIRTIO_BALLOON_S_CACHED   8   /* Cached memory as in /proc */\n> > +#define VIRTIO_BALLOON_S_NR       9\n> > \n> > /*\n> >  * Memory statistics structure.\n> > -- \n> > 2.14.1\n> > \n> > \n> > ---------------------------------------------------------------------\n> > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org\n> > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org\n> >   \n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3yd34W6sxNz9s4s\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 17 Nov 2017 01:08:26 +1100 (AEDT)","from localhost ([::1]:41069 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eFKq6-0000Wq-Sd\n\tfor incoming@patchwork.ozlabs.org; Thu, 16 Nov 2017 09:08:22 -0500","from eggs.gnu.org ([2001:4830:134:3::10]:37776)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <tgolembi@redhat.com>) id 1eFKpX-0000Ue-Ao\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 09:07:50 -0500","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <tgolembi@redhat.com>) id 1eFKpN-0007iI-G7\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 09:07:47 -0500","from mail-wm0-f68.google.com ([74.125.82.68]:42783)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <tgolembi@redhat.com>) id 1eFKpN-0007hO-9r\n\tfor qemu-devel@nongnu.org; Thu, 16 Nov 2017 09:07:37 -0500","by mail-wm0-f68.google.com with SMTP id 70so253466wmf.1\n\tfor <qemu-devel@nongnu.org>; Thu, 16 Nov 2017 06:07:37 -0800 (PST)","from fiorina (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tz37sm636439wrc.31.2017.11.16.06.07.35\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 16 Nov 2017 06:07:35 -0800 (PST)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to\n\t:references:organization:mime-version:content-transfer-encoding;\n\tbh=xbK7Msqa0cIshFmR0VhguG5unKnOnaKCfH0enZtmGJY=;\n\tb=jvwgN03+dcMRZMF1AdKYNt9aCP/GgnuE/AE0l59wU8qnsuFZXPg341OOgXHtJyA8fX\n\thDcsJ7wHDRRKO63AJbjbDSQgi9plgy/q9ArE+UX3ErhhH3EJl8qSCyD27tHrBcNBu7qM\n\tGhW6/pPAdC8r7OfLOilTZxTVS+dQ1Ki+S9JdWqde8ZDjQWt1cYD75N2vmj2szh1vZk16\n\t/hkHKnB1sPdm5RWkRO/Azj1O75yaB7f9G45WSxpdinUAXZX+8fRQmiCEO8xh0PEY6OJC\n\tZeoc671sbXb7tf8XCZ/o9PniU5+ICGGLla1mmWqUZQeMiDayGiEJLFXsreVcL5oX5pzP\n\tQljw==","X-Gm-Message-State":"AJaThX5LzK5texZMDQ/lEl0KxawWdn3kMVln7MPNswF+s2EytPwZtZn2\n\tLw2AFr5b+vvJ6H+C4jjr/+DH2g==","X-Google-Smtp-Source":"AGs4zMZfX/XeoNVjRvaFqQoRz2dSQIw0tZeYgvfvd0EUW8urLFC8yEkUhCaVoFdrS5gCMOtBWmwgkA==","X-Received":"by 10.28.61.87 with SMTP id k84mr1572929wma.48.1510841255993;\n\tThu, 16 Nov 2017 06:07:35 -0800 (PST)","Date":"Thu, 16 Nov 2017 15:07:33 +0100","From":"=?utf-8?b?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= <tgolembi@redhat.com>","To":"Yan Vugenfirer <yvugenfi@redhat.com>","Message-ID":"<20171116150733.2dccc760@fiorina>","In-Reply-To":"<181C9C1B-9119-4B1D-8327-0C5EFD42A5F5@redhat.com>","References":"<cover.1505923516.git.tgolembi@redhat.com>\n\t<13ca7e373615efac74661590527067ee8966f027.1505923516.git.tgolembi@redhat.com>\n\t<181C9C1B-9119-4B1D-8327-0C5EFD42A5F5@redhat.com>","Organization":"Red Hat","X-Mailer":"Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"74.125.82.68","Subject":"Re: [Qemu-devel] [virtio-dev] [PATCH 1/1] virtio-balloon: include\n\tbuffers and chached memory statistics","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"virtio-dev@lists.oasis-open.org, Wei Wang <wei.w.wang@intel.com>,\n\tqemu-devel <qemu-devel@nongnu.org>, \"Michael S. Tsirkin\" <mst@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]