mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] Drivers: hv: balloon: Make adjustments to the pressure report
@ 2013-01-26  0:18 K. Y. Srinivasan
  0 siblings, 0 replies; 2+ messages in thread
From: K. Y. Srinivasan @ 2013-01-26  0:18 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, jasowang, linux-scsi
  Cc: K. Y. Srinivasan

The host expects that the pressure report includes the pressure due to the
pages that have been ballooned. Make necessary adjustments to reflect that.
Also, include the free memory information in the pressure report.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_balloon.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index ce6f984..32a96f1 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -529,15 +529,21 @@ static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg)
 static void post_status(struct hv_dynmem_device *dm)
 {
 	struct dm_status status;
+	struct sysinfo val;
 
-
+	si_meminfo(&val);
 	memset(&status, 0, sizeof(struct dm_status));
 	status.hdr.type = DM_STATUS_REPORT;
 	status.hdr.size = sizeof(struct dm_status);
 	status.hdr.trans_id = atomic_inc_return(&trans_id);
 
-
-	status.num_committed = vm_memory_committed();
+	/*
+	 * The host expects the guest to report free memory.
+	 * Further, the host expects the pressure information to
+	 * include the ballooned out pages.
+	 */
+	status.num_avail = val.freeram;
+	status.num_committed = vm_memory_committed() + dm->num_pages_ballooned;
 
 	vmbus_sendpacket(dm->dev->channel, &status,
 				sizeof(struct dm_status),
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 1/1] Drivers: hv: balloon: Make adjustments to the pressure report
@ 2013-01-25 23:52 K. Y. Srinivasan
  0 siblings, 0 replies; 2+ messages in thread
From: K. Y. Srinivasan @ 2013-01-25 23:52 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, ohering, jbottomley, jasowang, linux-scsi
  Cc: K. Y. Srinivasan

The host expects that the pressure report includes the pressure due to the
pages that have been ballooned. Make necessary adjustments to reflect that.
Also, include the free memory information in the pressure report.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/hv/hv_balloon.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index ce6f984..32a96f1 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -529,15 +529,21 @@ static void process_info(struct hv_dynmem_device *dm, struct dm_info_msg *msg)
 static void post_status(struct hv_dynmem_device *dm)
 {
 	struct dm_status status;
+	struct sysinfo val;
 
-
+	si_meminfo(&val);
 	memset(&status, 0, sizeof(struct dm_status));
 	status.hdr.type = DM_STATUS_REPORT;
 	status.hdr.size = sizeof(struct dm_status);
 	status.hdr.trans_id = atomic_inc_return(&trans_id);
 
-
-	status.num_committed = vm_memory_committed();
+	/*
+	 * The host expects the guest to report free memory.
+	 * Further, the host expects the pressure information to
+	 * include the ballooned out pages.
+	 */
+	status.num_avail = val.freeram;
+	status.num_committed = vm_memory_committed() + dm->num_pages_ballooned;
 
 	vmbus_sendpacket(dm->dev->channel, &status,
 				sizeof(struct dm_status),
-- 
1.7.4.1


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

end of thread, other threads:[~2013-01-25 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-26  0:18 [PATCH 1/1] Drivers: hv: balloon: Make adjustments to the pressure report K. Y. Srinivasan
  -- strict thread matches above, loose matches on Subject: below --
2013-01-25 23:52 K. Y. Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®