Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0731572b authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

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: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 06a8f1fe
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -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)
static void post_status(struct hv_dynmem_device *dm)
{
{
	struct dm_status status;
	struct dm_status status;
	struct sysinfo val;



	si_meminfo(&val);
	memset(&status, 0, sizeof(struct dm_status));
	memset(&status, 0, sizeof(struct dm_status));
	status.hdr.type = DM_STATUS_REPORT;
	status.hdr.type = DM_STATUS_REPORT;
	status.hdr.size = sizeof(struct dm_status);
	status.hdr.size = sizeof(struct dm_status);
	status.hdr.trans_id = atomic_inc_return(&trans_id);
	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,
	vmbus_sendpacket(dm->dev->channel, &status,
				sizeof(struct dm_status),
				sizeof(struct dm_status),