All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
@ 2020-04-15 17:44 ` Alexander Duyck
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Duyck @ 2020-04-15 17:44 UTC (permalink / raw)
  To: jasowang, david, mst; +Cc: virtio-dev, virtualization

From: Alexander Duyck <alexander.h.duyck@linux.intel.com>

It can be confusing to have multiple features within the same driver that
are using the same verbage. As such this patch is creating a union of
free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
the userspace code a bit in terms of readability while maintaining the
functionality of legacy code.

Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
---
 drivers/virtio/virtio_balloon.c     |    2 +-
 include/uapi/linux/virtio_balloon.h |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 0ef16566c3f3..95d9c2f0a7be 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
 	if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
 			       &vb->config_read_bitmap))
 		virtio_cread(vb->vdev, struct virtio_balloon_config,
-			     free_page_report_cmd_id,
+			     free_page_hint_cmd_id,
 			     &vb->cmd_id_received_cache);
 
 	return vb->cmd_id_received_cache;
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 19974392d324..dc3e656470dd 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/linux/virtio_balloon.h
@@ -48,8 +48,15 @@ struct virtio_balloon_config {
 	__u32 num_pages;
 	/* Number of pages we've actually got in balloon. */
 	__u32 actual;
-	/* Free page report command id, readonly by guest */
-	__u32 free_page_report_cmd_id;
+	/*
+	 * Free page hint command id, readonly by guest.
+	 * Was previously named free_page_report_cmd_id so we
+	 * need to carry that name for legacy support.
+	 */
+	union {
+		__u32 free_page_hint_cmd_id;
+		__u32 free_page_report_cmd_id;	/* deprecated */
+	};
 	/* Stores PAGE_POISON if page poisoning is in use */
 	__u32 poison_val;
 };

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

* [virtio-dev] [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
@ 2020-04-15 17:44 ` Alexander Duyck
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Duyck @ 2020-04-15 17:44 UTC (permalink / raw)
  To: jasowang, david, mst; +Cc: virtio-dev, virtualization

From: Alexander Duyck <alexander.h.duyck@linux.intel.com>

It can be confusing to have multiple features within the same driver that
are using the same verbage. As such this patch is creating a union of
free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
the userspace code a bit in terms of readability while maintaining the
functionality of legacy code.

Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
---
 drivers/virtio/virtio_balloon.c     |    2 +-
 include/uapi/linux/virtio_balloon.h |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 0ef16566c3f3..95d9c2f0a7be 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
 	if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
 			       &vb->config_read_bitmap))
 		virtio_cread(vb->vdev, struct virtio_balloon_config,
-			     free_page_report_cmd_id,
+			     free_page_hint_cmd_id,
 			     &vb->cmd_id_received_cache);
 
 	return vb->cmd_id_received_cache;
diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
index 19974392d324..dc3e656470dd 100644
--- a/include/uapi/linux/virtio_balloon.h
+++ b/include/uapi/linux/virtio_balloon.h
@@ -48,8 +48,15 @@ struct virtio_balloon_config {
 	__u32 num_pages;
 	/* Number of pages we've actually got in balloon. */
 	__u32 actual;
-	/* Free page report command id, readonly by guest */
-	__u32 free_page_report_cmd_id;
+	/*
+	 * Free page hint command id, readonly by guest.
+	 * Was previously named free_page_report_cmd_id so we
+	 * need to carry that name for legacy support.
+	 */
+	union {
+		__u32 free_page_hint_cmd_id;
+		__u32 free_page_report_cmd_id;	/* deprecated */
+	};
 	/* Stores PAGE_POISON if page poisoning is in use */
 	__u32 poison_val;
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


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

* Re: [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
  2020-04-15 17:44 ` [virtio-dev] " Alexander Duyck
@ 2020-04-15 17:45   ` David Hildenbrand
  -1 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2020-04-15 17:45 UTC (permalink / raw)
  To: Alexander Duyck, jasowang, mst; +Cc: virtio-dev, virtualization

On 15.04.20 19:44, Alexander Duyck wrote:
> From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> 
> It can be confusing to have multiple features within the same driver that
> are using the same verbage. As such this patch is creating a union of
> free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
> the userspace code a bit in terms of readability while maintaining the
> functionality of legacy code.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> ---
>  drivers/virtio/virtio_balloon.c     |    2 +-
>  include/uapi/linux/virtio_balloon.h |   11 +++++++++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 0ef16566c3f3..95d9c2f0a7be 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
>  	if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
>  			       &vb->config_read_bitmap))
>  		virtio_cread(vb->vdev, struct virtio_balloon_config,
> -			     free_page_report_cmd_id,
> +			     free_page_hint_cmd_id,
>  			     &vb->cmd_id_received_cache);
>  
>  	return vb->cmd_id_received_cache;
> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
> index 19974392d324..dc3e656470dd 100644
> --- a/include/uapi/linux/virtio_balloon.h
> +++ b/include/uapi/linux/virtio_balloon.h
> @@ -48,8 +48,15 @@ struct virtio_balloon_config {
>  	__u32 num_pages;
>  	/* Number of pages we've actually got in balloon. */
>  	__u32 actual;
> -	/* Free page report command id, readonly by guest */
> -	__u32 free_page_report_cmd_id;
> +	/*
> +	 * Free page hint command id, readonly by guest.
> +	 * Was previously named free_page_report_cmd_id so we
> +	 * need to carry that name for legacy support.
> +	 */
> +	union {
> +		__u32 free_page_hint_cmd_id;
> +		__u32 free_page_report_cmd_id;	/* deprecated */
> +	};
>  	/* Stores PAGE_POISON if page poisoning is in use */
>  	__u32 poison_val;
>  };
> 

Can we also change the comment of

#define VIRTIO_BALLOON_F_FREE_PAGE_HINT	 /* VQ to report free pages */

?

Thanks!

-- 
Thanks,

David / dhildenb

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

* [virtio-dev] Re: [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
@ 2020-04-15 17:45   ` David Hildenbrand
  0 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2020-04-15 17:45 UTC (permalink / raw)
  To: Alexander Duyck, jasowang, mst; +Cc: virtio-dev, virtualization

On 15.04.20 19:44, Alexander Duyck wrote:
> From: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> 
> It can be confusing to have multiple features within the same driver that
> are using the same verbage. As such this patch is creating a union of
> free_page_report_cmd_id with free_page_hint_cmd_id so that we can clean-up
> the userspace code a bit in terms of readability while maintaining the
> functionality of legacy code.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> ---
>  drivers/virtio/virtio_balloon.c     |    2 +-
>  include/uapi/linux/virtio_balloon.h |   11 +++++++++--
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 0ef16566c3f3..95d9c2f0a7be 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -580,7 +580,7 @@ static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
>  	if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
>  			       &vb->config_read_bitmap))
>  		virtio_cread(vb->vdev, struct virtio_balloon_config,
> -			     free_page_report_cmd_id,
> +			     free_page_hint_cmd_id,
>  			     &vb->cmd_id_received_cache);
>  
>  	return vb->cmd_id_received_cache;
> diff --git a/include/uapi/linux/virtio_balloon.h b/include/uapi/linux/virtio_balloon.h
> index 19974392d324..dc3e656470dd 100644
> --- a/include/uapi/linux/virtio_balloon.h
> +++ b/include/uapi/linux/virtio_balloon.h
> @@ -48,8 +48,15 @@ struct virtio_balloon_config {
>  	__u32 num_pages;
>  	/* Number of pages we've actually got in balloon. */
>  	__u32 actual;
> -	/* Free page report command id, readonly by guest */
> -	__u32 free_page_report_cmd_id;
> +	/*
> +	 * Free page hint command id, readonly by guest.
> +	 * Was previously named free_page_report_cmd_id so we
> +	 * need to carry that name for legacy support.
> +	 */
> +	union {
> +		__u32 free_page_hint_cmd_id;
> +		__u32 free_page_report_cmd_id;	/* deprecated */
> +	};
>  	/* Stores PAGE_POISON if page poisoning is in use */
>  	__u32 poison_val;
>  };
> 

Can we also change the comment of

#define VIRTIO_BALLOON_F_FREE_PAGE_HINT	 /* VQ to report free pages */

?

Thanks!

-- 
Thanks,

David / dhildenb


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


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

* Re: [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
  2020-04-15 17:45   ` [virtio-dev] " David Hildenbrand
@ 2020-04-15 18:33     ` Alexander Duyck
  -1 siblings, 0 replies; 6+ messages in thread
From: Alexander Duyck @ 2020-04-15 18:33 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: virtio-dev, virtualization, Michael S. Tsirkin

On Wed, Apr 15, 2020 at 10:46 AM David Hildenbrand <david@redhat.com> wrote:
> Can we also change the comment of
>
> #define VIRTIO_BALLOON_F_FREE_PAGE_HINT  /* VQ to report free pages */
>
> ?
>
> Thanks!

No problem. I will update and submit a v2.

Thanks.

- Alex

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

* [virtio-dev] Re: [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting
@ 2020-04-15 18:33     ` Alexander Duyck
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Duyck @ 2020-04-15 18:33 UTC (permalink / raw)
  To: David Hildenbrand
  Cc: Jason Wang, Michael S. Tsirkin, virtio-dev, virtualization

On Wed, Apr 15, 2020 at 10:46 AM David Hildenbrand <david@redhat.com> wrote:
> Can we also change the comment of
>
> #define VIRTIO_BALLOON_F_FREE_PAGE_HINT  /* VQ to report free pages */
>
> ?
>
> Thanks!

No problem. I will update and submit a v2.

Thanks.

- Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org


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

end of thread, other threads:[~2020-04-15 18:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 17:44 [PATCH] virtio-balloon: Avoid using the word 'report' when referring to free page hinting Alexander Duyck
2020-04-15 17:44 ` [virtio-dev] " Alexander Duyck
2020-04-15 17:45 ` David Hildenbrand
2020-04-15 17:45   ` [virtio-dev] " David Hildenbrand
2020-04-15 18:33   ` Alexander Duyck
2020-04-15 18:33     ` [virtio-dev] " Alexander Duyck

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.