]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
hv_balloon: Balloon up according to request page number
authorTianyu Lan <Tianyu.Lan@microsoft.com>
Sat, 25 Jan 2020 21:50:47 +0000 (16:50 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:31:00 +0000 (00:31 -0400)
commit6aafe078a3e19893b1a9b205499dca2ee5c6568f
treef1e6cd93d940a668be6af0c5a62f9ca5018a0c1c
parent31a0eb3453d1d1888d9d6883a3cb682fbc1ecc5b
hv_balloon: Balloon up according to request page number

BugLink: https://bugs.launchpad.net/bugs/1866678
commit d33c240d47dab4fd15123d9e73fc8810cbc6ed6a upstream.

Current code has assumption that balloon request memory size aligns
with 2MB. But actually Hyper-V doesn't guarantee such alignment. When
balloon driver receives non-aligned balloon request, it produces warning
and balloon up more memory than requested in order to keep 2MB alignment.
Remove the warning and balloon up memory according to actual requested
memory size.

Fixes: f6712238471a ("hv: hv_balloon: avoid memory leak on alloc_error of 2MB memory block")
Cc: stable@vger.kernel.org
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hv/hv_balloon.c