hv_balloon: Add support for configurable order free page reporting
authorShradha Gupta <shradhagupta@linux.microsoft.com>
Fri, 30 Sep 2022 06:01:39 +0000 (23:01 -0700)
committerWei Liu <wei.liu@kernel.org>
Mon, 28 Nov 2022 16:48:20 +0000 (16:48 +0000)
commitdc60f2db39c3f8da4490c1ed827022bbc925d81c
treee6eb489cac8bc9de6af7fbf5e81226cf990d1126
parentaebb02ce8b36d20464404206b89069dc9239a7f0
hv_balloon: Add support for configurable order free page reporting

Newer versions of Hyper-V allow reporting unused guest pages in chunks
smaller than 2 Mbytes.  Using smaller chunks allows reporting more
unused guest pages, but with increased overhead in the finding the
small chunks.  To make this tradeoff configurable, use the existing
page_reporting_order module parameter to control the reporting order.
Drop and refine checks that restricted the minimun page reporting order
to 2Mbytes size pages. Add appropriate checks to make sure the
underlying Hyper-V versions support cold discard hints of any order
(and not just starting from 9)

Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1664517699-1085-3-git-send-email-shradhagupta@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/hv_balloon.c