vmw_balloon: Split refused pages
authorNadav Amit <namit@vmware.com>
Thu, 25 Apr 2019 11:54:45 +0000 (04:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 May 2019 18:19:17 +0000 (20:19 +0200)
commitae29783d3333b828cdc3f9276e110db1a2f7cc4c
tree6250bb32892d43d77120091abf972850f76b0202
parent5d1a86ecf328586fbedf7b66595ac3c7039eb8c8
vmw_balloon: Split refused pages

The hypervisor might refuse to inflate pages. While the balloon driver
handles this scenario correctly, a refusal to inflate a 2MB pages might
cause the same page to be allocated again later just for its inflation
to be refused again. This wastes energy and time.

To avoid this situation, split the 2MB page to 4KB pages, and then try
to inflate each one individually. Most of the 4KB pages out of the 2MB
should be inflated successfully, and the balloon is likely to prevent
the scenario of repeated refused inflation.

Reviewed-by: Xavier Deguillard <xdeguillard@vmware.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_balloon.c