Commit 79208c57 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Drivers: hv: hv_balloon: Make adjustments in computing the floor

Make adjustments in computing the balloon floor. The current computation
of the balloon floor was not appropriate for virtual machines with more than
10 GB of assigned memory - we would get into situations where the host would
agressively balloon down the guest and leave the guest in an unusable state.
This patch fixes the issue by raising the floor.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c1136da6
...@@ -928,9 +928,8 @@ static unsigned long compute_balloon_floor(void) ...@@ -928,9 +928,8 @@ static unsigned long compute_balloon_floor(void)
* 128 72 (1/2) * 128 72 (1/2)
* 512 168 (1/4) * 512 168 (1/4)
* 2048 360 (1/8) * 2048 360 (1/8)
* 8192 552 (1/32) * 8192 768 (1/16)
* 32768 1320 * 32768 1536 (1/32)
* 131072 4392
*/ */
if (totalram_pages < MB2PAGES(128)) if (totalram_pages < MB2PAGES(128))
min_pages = MB2PAGES(8) + (totalram_pages >> 1); min_pages = MB2PAGES(8) + (totalram_pages >> 1);
...@@ -938,8 +937,10 @@ static unsigned long compute_balloon_floor(void) ...@@ -938,8 +937,10 @@ static unsigned long compute_balloon_floor(void)
min_pages = MB2PAGES(40) + (totalram_pages >> 2); min_pages = MB2PAGES(40) + (totalram_pages >> 2);
else if (totalram_pages < MB2PAGES(2048)) else if (totalram_pages < MB2PAGES(2048))
min_pages = MB2PAGES(104) + (totalram_pages >> 3); min_pages = MB2PAGES(104) + (totalram_pages >> 3);
else if (totalram_pages < MB2PAGES(8192))
min_pages = MB2PAGES(256) + (totalram_pages >> 4);
else else
min_pages = MB2PAGES(296) + (totalram_pages >> 5); min_pages = MB2PAGES(512) + (totalram_pages >> 5);
#undef MB2PAGES #undef MB2PAGES
return min_pages; return min_pages;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment