aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2013-01-25 19:18:47 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-30 00:06:07 -0500
commit0731572b6c529f8e8a320dc4df6d67d9a595ecf3 (patch)
treec331d4381a5439424f84992e2489c45340459f3c /drivers/hv
parent06a8f1feb9e82e5b66f781ba3e39055e3f89a641 (diff)
Drivers: hv: balloon: Make adjustments to the pressure report
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_balloon.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index ce6f984535ec..32a96f164dc8 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)
529static void post_status(struct hv_dynmem_device *dm) 529static void post_status(struct hv_dynmem_device *dm)
530{ 530{
531 struct dm_status status; 531 struct dm_status status;
532 struct sysinfo val;
532 533
533 534 si_meminfo(&val);
534 memset(&status, 0, sizeof(struct dm_status)); 535 memset(&status, 0, sizeof(struct dm_status));
535 status.hdr.type = DM_STATUS_REPORT; 536 status.hdr.type = DM_STATUS_REPORT;
536 status.hdr.size = sizeof(struct dm_status); 537 status.hdr.size = sizeof(struct dm_status);
537 status.hdr.trans_id = atomic_inc_return(&trans_id); 538 status.hdr.trans_id = atomic_inc_return(&trans_id);
538 539
539 540 /*
540 status.num_committed = vm_memory_committed(); 541 * The host expects the guest to report free memory.
542 * Further, the host expects the pressure information to
543 * include the ballooned out pages.
544 */
545 status.num_avail = val.freeram;
546 status.num_committed = vm_memory_committed() + dm->num_pages_ballooned;
541 547
542 vmbus_sendpacket(dm->dev->channel, &status, 548 vmbus_sendpacket(dm->dev->channel, &status,
543 sizeof(struct dm_status), 549 sizeof(struct dm_status),