From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-2712-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [66.179.20.138]) by lists.oasis-open.org (Postfix) with ESMTP id 7C8635818F4D for ; Tue, 28 Nov 2017 17:24:08 -0800 (PST) Date: Wed, 29 Nov 2017 03:24:02 +0200 From: "Michael S. Tsirkin" Message-ID: <20171129032348-mutt-send-email-mst@kernel.org> References: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> Subject: [virtio-dev] Re: [PATCH v3] virtio_balloon: include disk/file caches memory statistics To: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Huang Ying , Gal Hammer , Jason Wang , Amnon Ilan , Wei Wang , Shaohua Li , Rik van Riel List-ID: On Sun, Nov 12, 2017 at 01:05:38PM +0100, Tomáš Golembiovský wrote: > Add a new field VIRTIO_BALLOON_S_CACHES to virtio_balloon memory > statistics protocol. The value represents all disk/file caches. > > In this case it corresponds to the sum of values > Buffers+Cached+SwapCached from /proc/meminfo. > > Signed-off-by: Tomáš Golembiovský I parked this on vhost branch, part of linux next. > --- > drivers/virtio/virtio_balloon.c | 4 ++++ > include/uapi/linux/virtio_balloon.h | 3 ++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index f0b3a0b9d42f..d2bd13bbaf9f 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -244,11 +244,13 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > struct sysinfo i; > unsigned int idx = 0; > long available; > + unsigned long caches; > > all_vm_events(events); > si_meminfo(&i); > > available = si_mem_available(); > + caches = global_node_page_state(NR_FILE_PAGES); > > #ifdef CONFIG_VM_EVENT_COUNTERS > update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN, > @@ -264,6 +266,8 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > pages_to_bytes(i.totalram)); > update_stat(vb, idx++, VIRTIO_BALLOON_S_AVAIL, > pages_to_bytes(available)); > + update_stat(vb, idx++, VIRTIO_BALLOON_S_CACHES, > + pages_to_bytes(caches)); > > return idx; > } > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index 343d7ddefe04..4e8b8304b793 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,7 +52,8 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ > #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_NR 7 > +#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ > +#define VIRTIO_BALLOON_S_NR 8 > > /* > * Memory statistics structure. > -- > 2.15.0 --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v3] virtio_balloon: include disk/file caches memory statistics Date: Wed, 29 Nov 2017 03:24:02 +0200 Message-ID: <20171129032348-mutt-send-email-mst@kernel.org> References: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Huang Ying , Gal Hammer , Jason Wang , Amnon Ilan , Wei Wang , Shaohua Li , Rik van Riel To: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Return-path: Content-Disposition: inline In-Reply-To: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On Sun, Nov 12, 2017 at 01:05:38PM +0100, Tomáš Golembiovský wrote: > Add a new field VIRTIO_BALLOON_S_CACHES to virtio_balloon memory > statistics protocol. The value represents all disk/file caches. > > In this case it corresponds to the sum of values > Buffers+Cached+SwapCached from /proc/meminfo. > > Signed-off-by: Tomáš Golembiovský I parked this on vhost branch, part of linux next. > --- > drivers/virtio/virtio_balloon.c | 4 ++++ > include/uapi/linux/virtio_balloon.h | 3 ++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index f0b3a0b9d42f..d2bd13bbaf9f 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -244,11 +244,13 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > struct sysinfo i; > unsigned int idx = 0; > long available; > + unsigned long caches; > > all_vm_events(events); > si_meminfo(&i); > > available = si_mem_available(); > + caches = global_node_page_state(NR_FILE_PAGES); > > #ifdef CONFIG_VM_EVENT_COUNTERS > update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN, > @@ -264,6 +266,8 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > pages_to_bytes(i.totalram)); > update_stat(vb, idx++, VIRTIO_BALLOON_S_AVAIL, > pages_to_bytes(available)); > + update_stat(vb, idx++, VIRTIO_BALLOON_S_CACHES, > + pages_to_bytes(caches)); > > return idx; > } > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index 343d7ddefe04..4e8b8304b793 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,7 +52,8 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ > #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_NR 7 > +#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ > +#define VIRTIO_BALLOON_S_NR 8 > > /* > * Memory statistics structure. > -- > 2.15.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f199.google.com (mail-ot0-f199.google.com [74.125.82.199]) by kanga.kvack.org (Postfix) with ESMTP id A9C9D6B0033 for ; Tue, 28 Nov 2017 20:24:07 -0500 (EST) Received: by mail-ot0-f199.google.com with SMTP id r11so929974ote.20 for ; Tue, 28 Nov 2017 17:24:07 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id f69si168851oib.69.2017.11.28.17.24.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Nov 2017 17:24:06 -0800 (PST) Date: Wed, 29 Nov 2017 03:24:02 +0200 From: "Michael S. Tsirkin" Subject: Re: [PATCH v3] virtio_balloon: include disk/file caches memory statistics Message-ID: <20171129032348-mutt-send-email-mst@kernel.org> References: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Huang Ying , Gal Hammer , Jason Wang , Amnon Ilan , Wei Wang , Shaohua Li , Rik van Riel On Sun, Nov 12, 2017 at 01:05:38PM +0100, TomA!A! GolembiovskA 1/2 wrote: > Add a new field VIRTIO_BALLOON_S_CACHES to virtio_balloon memory > statistics protocol. The value represents all disk/file caches. > > In this case it corresponds to the sum of values > Buffers+Cached+SwapCached from /proc/meminfo. > > Signed-off-by: TomA!A! GolembiovskA 1/2 I parked this on vhost branch, part of linux next. > --- > drivers/virtio/virtio_balloon.c | 4 ++++ > include/uapi/linux/virtio_balloon.h | 3 ++- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c > index f0b3a0b9d42f..d2bd13bbaf9f 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -244,11 +244,13 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > struct sysinfo i; > unsigned int idx = 0; > long available; > + unsigned long caches; > > all_vm_events(events); > si_meminfo(&i); > > available = si_mem_available(); > + caches = global_node_page_state(NR_FILE_PAGES); > > #ifdef CONFIG_VM_EVENT_COUNTERS > update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN, > @@ -264,6 +266,8 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb) > pages_to_bytes(i.totalram)); > update_stat(vb, idx++, VIRTIO_BALLOON_S_AVAIL, > pages_to_bytes(available)); > + update_stat(vb, idx++, VIRTIO_BALLOON_S_CACHES, > + pages_to_bytes(caches)); > > return idx; > } > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h > index 343d7ddefe04..4e8b8304b793 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,7 +52,8 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ > #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_NR 7 > +#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ > +#define VIRTIO_BALLOON_S_NR 8 > > /* > * Memory statistics structure. > -- > 2.15.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJr6h-0001eE-6p for qemu-devel@nongnu.org; Tue, 28 Nov 2017 20:24:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJr6d-0003Dv-8T for qemu-devel@nongnu.org; Tue, 28 Nov 2017 20:24:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJr6d-0003Da-0w for qemu-devel@nongnu.org; Tue, 28 Nov 2017 20:24:07 -0500 Date: Wed, 29 Nov 2017 03:24:02 +0200 From: "Michael S. Tsirkin" Message-ID: <20171129032348-mutt-send-email-mst@kernel.org> References: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2e8c12f5242bcf755a33ee3a0e9ef94339d1808c.1510487579.git.tgolembi@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3] virtio_balloon: include disk/file caches memory statistics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?B?VG9tw6HFoSBHb2xlbWJpb3Zza8O9?= Cc: linux-mm@kvack.org, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, Huang Ying , Gal Hammer , Jason Wang , Amnon Ilan , Wei Wang , Shaohua Li , Rik van Riel On Sun, Nov 12, 2017 at 01:05:38PM +0100, Tom=C3=A1=C5=A1 Golembiovsk=C3=BD= wrote: > Add a new field VIRTIO_BALLOON_S_CACHES to virtio_balloon memory > statistics protocol. The value represents all disk/file caches. >=20 > In this case it corresponds to the sum of values > Buffers+Cached+SwapCached from /proc/meminfo. >=20 > Signed-off-by: Tom=C3=A1=C5=A1 Golembiovsk=C3=BD I parked this on vhost branch, part of linux next. > --- > drivers/virtio/virtio_balloon.c | 4 ++++ > include/uapi/linux/virtio_balloon.h | 3 ++- > 2 files changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_ba= lloon.c > index f0b3a0b9d42f..d2bd13bbaf9f 100644 > --- a/drivers/virtio/virtio_balloon.c > +++ b/drivers/virtio/virtio_balloon.c > @@ -244,11 +244,13 @@ static unsigned int update_balloon_stats(struct v= irtio_balloon *vb) > struct sysinfo i; > unsigned int idx =3D 0; > long available; > + unsigned long caches; > =20 > all_vm_events(events); > si_meminfo(&i); > =20 > available =3D si_mem_available(); > + caches =3D global_node_page_state(NR_FILE_PAGES); > =20 > #ifdef CONFIG_VM_EVENT_COUNTERS > update_stat(vb, idx++, VIRTIO_BALLOON_S_SWAP_IN, > @@ -264,6 +266,8 @@ static unsigned int update_balloon_stats(struct vir= tio_balloon *vb) > pages_to_bytes(i.totalram)); > update_stat(vb, idx++, VIRTIO_BALLOON_S_AVAIL, > pages_to_bytes(available)); > + update_stat(vb, idx++, VIRTIO_BALLOON_S_CACHES, > + pages_to_bytes(caches)); > =20 > return idx; > } > diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/v= irtio_balloon.h > index 343d7ddefe04..4e8b8304b793 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h > @@ -52,7 +52,8 @@ struct virtio_balloon_config { > #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory *= / > #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_NR 7 > +#define VIRTIO_BALLOON_S_CACHES 7 /* Disk caches */ > +#define VIRTIO_BALLOON_S_NR 8 > =20 > /* > * Memory statistics structure. > --=20 > 2.15.0