All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] virtio_balloon: export hugetlb page allocation counts
@ 2018-03-19 22:14 Jonathan Helman
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Helman @ 2018-03-19 22:14 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtio-dev, linux-kernel, virtualization

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 <jonathan.helman@oracle.com>
---
 drivers/virtio/virtio_balloon.c     | 6 ++++++
 include/uapi/linux/virtio_balloon.h | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index dfe5684..6b237e3 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
 				pages_to_bytes(events[PSWPOUT]));
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
+#ifdef CONFIG_HUGETLB_PAGE
+	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
+		    events[HTLB_BUDDY_PGALLOC]);
+	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
+		    events[HTLB_BUDDY_PGALLOC_FAIL]);
+#endif
 #endif
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
 				pages_to_bytes(i.freeram));
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 4e8b830..40297a3 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/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 failures */
+#define VIRTIO_BALLOON_S_NR       10
 
 /*
  * Memory statistics structure.
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] virtio_balloon: export hugetlb page allocation counts
  2018-03-20  2:31   ` Jason Wang
@ 2018-03-20  4:26     ` Jonathan Helman
  -1 siblings, 0 replies; 6+ messages in thread
From: Jonathan Helman @ 2018-03-20  4:26 UTC (permalink / raw)
  To: Jason Wang; +Cc: mst, virtualization, linux-kernel, virtio-dev


> On Mar 19, 2018, at 7:31 PM, Jason Wang <jasowang@redhat.com> wrote:
> 
> 
> 
> On 2018年03月20日 06:14, Jonathan Helman wrote:
>> 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 <jonathan.helman@oracle.com>
> 
> Reviewed-by: Jason Wang <jasowang@redhat.com>

Thanks.

> 
>> ---
>>  drivers/virtio/virtio_balloon.c     | 6 ++++++
>>  include/uapi/linux/virtio_balloon.h | 4 +++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
>> index dfe5684..6b237e3 100644
>> --- a/drivers/virtio/virtio_balloon.c
>> +++ b/drivers/virtio/virtio_balloon.c
>> @@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
>>  				pages_to_bytes(events[PSWPOUT]));
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
>> +#ifdef CONFIG_HUGETLB_PAGE
>> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
>> +		    events[HTLB_BUDDY_PGALLOC]);
>> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
>> +		    events[HTLB_BUDDY_PGALLOC_FAIL]);
>> +#endif
>>  #endif
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
>>  				pages_to_bytes(i.freeram));
>> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
>> index 4e8b830..40297a3 100644
>> --- a/include/uapi/linux/virtio_balloon.h
>> +++ b/include/uapi/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 failures */
>> +#define VIRTIO_BALLOON_S_NR       10
>>    /*
>>   * Memory statistics structure.
> 
> Not for this patch, but it looks to me that exporting such nr through uapi is fragile.

Sorry, can you explain what you mean here?

Jon

> 
> Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] virtio_balloon: export hugetlb page allocation counts
@ 2018-03-20  4:26     ` Jonathan Helman
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Helman @ 2018-03-20  4:26 UTC (permalink / raw)
  To: Jason Wang; +Cc: virtio-dev, virtualization, linux-kernel, mst


> On Mar 19, 2018, at 7:31 PM, Jason Wang <jasowang@redhat.com> wrote:
> 
> 
> 
> On 2018年03月20日 06:14, Jonathan Helman wrote:
>> 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 <jonathan.helman@oracle.com>
> 
> Reviewed-by: Jason Wang <jasowang@redhat.com>

Thanks.

> 
>> ---
>>  drivers/virtio/virtio_balloon.c     | 6 ++++++
>>  include/uapi/linux/virtio_balloon.h | 4 +++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
>> index dfe5684..6b237e3 100644
>> --- a/drivers/virtio/virtio_balloon.c
>> +++ b/drivers/virtio/virtio_balloon.c
>> @@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
>>  				pages_to_bytes(events[PSWPOUT]));
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
>> +#ifdef CONFIG_HUGETLB_PAGE
>> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
>> +		    events[HTLB_BUDDY_PGALLOC]);
>> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
>> +		    events[HTLB_BUDDY_PGALLOC_FAIL]);
>> +#endif
>>  #endif
>>  	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
>>  				pages_to_bytes(i.freeram));
>> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
>> index 4e8b830..40297a3 100644
>> --- a/include/uapi/linux/virtio_balloon.h
>> +++ b/include/uapi/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 failures */
>> +#define VIRTIO_BALLOON_S_NR       10
>>    /*
>>   * Memory statistics structure.
> 
> Not for this patch, but it looks to me that exporting such nr through uapi is fragile.

Sorry, can you explain what you mean here?

Jon

> 
> Thanks

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] virtio_balloon: export hugetlb page allocation counts
  2018-03-19 22:14 Jonathan Helman
@ 2018-03-20  2:31   ` Jason Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-03-20  2:31 UTC (permalink / raw)
  To: Jonathan Helman, mst; +Cc: virtualization, linux-kernel, virtio-dev



On 2018年03月20日 06:14, Jonathan Helman wrote:
> 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 <jonathan.helman@oracle.com>

Reviewed-by: Jason Wang <jasowang@redhat.com>

> ---
>   drivers/virtio/virtio_balloon.c     | 6 ++++++
>   include/uapi/linux/virtio_balloon.h | 4 +++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index dfe5684..6b237e3 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
>   				pages_to_bytes(events[PSWPOUT]));
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
> +#ifdef CONFIG_HUGETLB_PAGE
> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
> +		    events[HTLB_BUDDY_PGALLOC]);
> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
> +		    events[HTLB_BUDDY_PGALLOC_FAIL]);
> +#endif
>   #endif
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
>   				pages_to_bytes(i.freeram));
> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
> index 4e8b830..40297a3 100644
> --- a/include/uapi/linux/virtio_balloon.h
> +++ b/include/uapi/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 failures */
> +#define VIRTIO_BALLOON_S_NR       10
>   
>   /*
>    * Memory statistics structure.

Not for this patch, but it looks to me that exporting such nr through 
uapi is fragile.

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] virtio_balloon: export hugetlb page allocation counts
@ 2018-03-20  2:31   ` Jason Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2018-03-20  2:31 UTC (permalink / raw)
  To: Jonathan Helman, mst; +Cc: virtio-dev, linux-kernel, virtualization



On 2018年03月20日 06:14, Jonathan Helman wrote:
> 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 <jonathan.helman@oracle.com>

Reviewed-by: Jason Wang <jasowang@redhat.com>

> ---
>   drivers/virtio/virtio_balloon.c     | 6 ++++++
>   include/uapi/linux/virtio_balloon.h | 4 +++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index dfe5684..6b237e3 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
>   				pages_to_bytes(events[PSWPOUT]));
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
> +#ifdef CONFIG_HUGETLB_PAGE
> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
> +		    events[HTLB_BUDDY_PGALLOC]);
> +	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
> +		    events[HTLB_BUDDY_PGALLOC_FAIL]);
> +#endif
>   #endif
>   	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
>   				pages_to_bytes(i.freeram));
> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
> index 4e8b830..40297a3 100644
> --- a/include/uapi/linux/virtio_balloon.h
> +++ b/include/uapi/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 failures */
> +#define VIRTIO_BALLOON_S_NR       10
>   
>   /*
>    * Memory statistics structure.

Not for this patch, but it looks to me that exporting such nr through 
uapi is fragile.

Thanks
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] virtio_balloon: export hugetlb page allocation counts
@ 2018-03-19 22:14 Jonathan Helman
  2018-03-20  2:31   ` Jason Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Helman @ 2018-03-19 22:14 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, linux-kernel, virtio-dev, Jonathan Helman

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 <jonathan.helman@oracle.com>
---
 drivers/virtio/virtio_balloon.c     | 6 ++++++
 include/uapi/linux/virtio_balloon.h | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index dfe5684..6b237e3 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -272,6 +272,12 @@ static unsigned int update_balloon_stats(struct virtio_balloon *vb)
 				pages_to_bytes(events[PSWPOUT]));
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MAJFLT, events[PGMAJFAULT]);
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MINFLT, events[PGFAULT]);
+#ifdef CONFIG_HUGETLB_PAGE
+	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGALLOC,
+		    events[HTLB_BUDDY_PGALLOC]);
+	update_stat(vb, idx++, VIRTIO_BALLOON_S_HTLB_PGFAIL,
+		    events[HTLB_BUDDY_PGALLOC_FAIL]);
+#endif
 #endif
 	update_stat(vb, idx++, VIRTIO_BALLOON_S_MEMFREE,
 				pages_to_bytes(i.freeram));
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 4e8b830..40297a3 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/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 failures */
+#define VIRTIO_BALLOON_S_NR       10
 
 /*
  * Memory statistics structure.
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-20  4:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 22:14 [PATCH v2] virtio_balloon: export hugetlb page allocation counts Jonathan Helman
2018-03-19 22:14 Jonathan Helman
2018-03-20  2:31 ` Jason Wang
2018-03-20  2:31   ` Jason Wang
2018-03-20  4:26   ` Jonathan Helman
2018-03-20  4:26     ` Jonathan Helman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.